Skip to content

perf: optimize extraction hot paths - #281

Merged
ryanfowler merged 1 commit into
mainfrom
perf/extraction-hot-paths
Sep 1, 2026
Merged

perf: optimize extraction hot paths#281
ryanfowler merged 1 commit into
mainfrom
perf/extraction-hot-paths

Conversation

@ryanfowler

Copy link
Copy Markdown
Owner

Summary

  • Reuse epoch/root-scoped chrome aggregates across cleanup passes.
  • Skip comment-specific scans when the fragment has no possible comment markers.
  • Avoid repeated dynamic attribute/name work on ordinary DOM nodes.
  • Const-specialize the common unfiltered scoring statistics traversal.
  • Preserve custom related-heading recognition and add regression coverage.

Performance

Controlled cargo bench --bench pipeline -- 'extract/large/prose$' --noplot runs used the same worktree, lockfile, and benchmark inputs with 100 samples:

  • main / clean HEAD: 45.314 ms median
  • this branch: 40.537 ms median
  • improvement: 10.53% lower wall time

Baseline and current runs were also profiled with perf record to identify cleanup, scoring, and attribute/name lookup hot paths.

Validation

  • cargo fmt --check
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo test (622 unit, 14 fixture, 130 Mozilla compatibility, 3 doctests)

Ready for review.

@ryanfowler
ryanfowler merged commit f8a195e into main Sep 1, 2026
6 checks passed
@ryanfowler
ryanfowler deleted the perf/extraction-hot-paths branch September 1, 2026 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant