Skip to content

Google: index ids for the jsl.dh splice, reuse the soup for extras (~… - #28

Merged
getlinksc merged 2 commits into
mainfrom
perf/google-parse-speed
Oct 28, 2026
Merged

getlinksc merged 2 commits into
mainfrom
perf/google-parse-speed

Conversation

@getlinksc

Copy link
Copy Markdown
Owner

…40% faster parse)

The AI-overview splice found each fragment's target with root.find(id=...), a walk of the whole tree per fragment and round: a third of a desktop parse. An id index built once gives the same element (first live one in document order; a repeated id still goes through find). parse_extras takes the soup parse already built instead of parsing the page again.

Same output on all 29 fixtures; 3.67 s -> 2.24 s over the 12 largest.

Description

Brief description of the changes.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Checklist

  • My code follows the project's style guidelines
  • I have added tests that prove my fix/feature works
  • All new and existing tests pass (uv run pytest)
  • Linting passes (uv run ruff check .)
  • Type checking passes (uv run mypy src/search_parser)
  • I have updated documentation as needed

Test Plan

How were these changes tested?

…40% faster parse)

The AI-overview splice found each fragment's target with root.find(id=...),
a walk of the whole tree per fragment and round: a third of a desktop
parse. An id index built once gives the same element (first live one in
document order; a repeated id still goes through find). parse_extras
takes the soup parse already built instead of parsing the page again.

Same output on all 29 fixtures; 3.67 s -> 2.24 s over the 12 largest.
Moves the Unreleased parse speed-up under 0.5.16.
@getlinksc
getlinksc merged commit 31b9c0d into main Oct 28, 2026
7 checks passed
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