Reduce resolver allocation and bound candidate loops - #205
Merged
Conversation
This was referenced Sep 5, 2026
jdalton
force-pushed
the
perf/resolver-execution
branch
2 times, most recently
from
September 6, 2026 02:30
faeaa66 to
90dfd95
Compare
jdalton
force-pushed
the
perf/resolver-execution
branch
from
September 6, 2026 11:40
90dfd95 to
2a1597b
Compare
Collaborator
Author
|
Integrated the merged legacy DOM and nth-index fixes. Added Node and WPT tests for bounded array/item loops and for adding, replacing, and omitting callbacks after matching is cached. Matching-cache keys now distinguish callback presence. All 465 Node tests and 49 WPT pages pass; CI is green, and coverage thresholds are unchanged. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tooling update
Rebased onto merged #212 as one commit. Sources and tests use
.mts, Node tests use Vitest, and the published JavaScript paths stay unchanged. The original engine changes are preserved.Local lint, formatting, Node and packed-package checks pass. All 41 WPT pages pass against both generated builds.
Change
Extract the remaining resolver-execution work from #167: bounded candidate loops, direct cached-plan fetches, null no-op resolvers, raw match-resolver arrays, captured slicing, and early tag rejection within a compound selector.
This applies to master independently. It does not include #188's context-free plan caching, the attribute-equality optimization, or legacy-DOM handling. Those changes have separate destinations and must be reconciled when combined.
The extraction corrects two archived item-loop defects: the result index was uninitialized, and the tail replaced the result array with
true. Compiled-cache keys now distinguish mode and callback presence, preventing a cached array loop or no-op from being reused for a different contract. Installed wrappers are tested with the captured slicing helper.Validation: all 7 focused Node tests and 4 shared-runtime tests pass with Node 26.5.0 and jsdom 30.0.1. Coverage includes cold/cached queries, mutation, callbacks, escaped classes, cache turnover, both collection modes, tag-read ordering, and installation. Commands and scope are in
docs/resolver-execution.md.No new performance claim is made; representative benchmarks should be rerun on the combined branch.