Repository navigation
fix(page-classifier): comments rule no longer quadratic in comment-class containers x h1s - #1193
Conversation
Auto-review did not completeThe
Partial findings recovered from the session (incomplete, unverified, and NOT a merge signal): Show partial reviewI found no bugs in this PR. I read the diff only and did not run the tests or the benchmark.
|
|
Reviewed the diff. I found no correctness problems and ran nothing locally.
(nit) s under one container, and a deep chain above them", but it has no deep chain. It is one container with 40,000 headings. Rename it, or add the chain.(nit) The 2 s timing bounds could flake on a heavily loaded CI runner. The 4x margin over the old 8 s case looks reasonable, but an effect-based assertion would be more robust, as AGENTS.md suggests. (low) The nested-containers test builds 40,000 levels of nesting. If the parser or a later rule recurses on depth, that could overflow the stack on other code paths. It passes now, so it is fine as it stands. |
433d8b8 to
c7048d9
Compare
Auto-review did not completeThe
Partial findings recovered from the session (incomplete, unverified, and NOT a merge signal): Show partial reviewI found no correctness bugs in this change, so none of the comments below are tagged high or critical. I read the diff but did not run the tests or check CI.
|
…1 once instead of testing every container against every h1 A page of 40,000 comment-class containers each holding an h1 took 8 s of CPU. Cost is now linear in the nodes touched; hostile-input test included. Docs: none. Skill: no change. Refs repo#3548. Signed-off-by: Nik Cubrilovic <[email protected]>
…oot once; tests for the nested and shared-ancestor shapes Review (Sonnet-high): the root lookup per container was still quadratic on a chain of nested comment-class divs (8 s at 40,000). Docs: none. Skill: no change. Signed-off-by: Nik Cubrilovic <[email protected]>
c7048d9 to
9112040
Compare
|
Reviewed the diff. I did not run the tests. The change looks correct. The ancestor-marking pass gives the same answers as the old
No blocking issues. |
A page of 40,000
<div class="comments"><h1>x</h1></div>took about 8 s of CPU in the classifier (1.7 MB page; 20,000: 1.7 s). The comments rule tested each comment-class container against every h1 on the page. It now marks the ancestors of each h1 once per root; the answers are unchanged, and the cost is linear in the nodes touched.<h1 class=comments-title>does not disqualify itself).Docs: none. Skill: no change. Refs squirrelscan/repo#3548 (private).