Skip to content

Optimize direct-subject selector invalidation - #891

Merged
wieslawsoltes merged 1 commit into
mainfrom
perf/direct-subject-selector-invalidation-243
Sep 21, 2026
Merged

wieslawsoltes merged 1 commit into
mainfrom
perf/direct-subject-selector-invalidation-243

Conversation

@wieslawsoltes

@wieslawsoltes wieslawsoltes commented Sep 21, 2026 •

Copy link
Copy Markdown
Collaborator

Repeated same-class mutations in unchanged Code OSS were still feeding every matching final-compound selector through the routed invalidation planner. A typical startup transition scanned 800–1,300 dependency entries even when the changed element was the only possible invalidation subject.

This change sends exact final-compound subject dependencies directly to the subject cascade queue while retaining the compiled planner for ancestor, descendant, child, sibling, and fallback routes. It also adds an A/B escape hatch, bounded tracing, a 64-subject/512-rule scaling regression, and a dedicated CTest lane.

Advances #243.

Result

On unchanged Code OSS 645f29cc, exact WebScene a99eaf2, and AppScene cd0a02e:

  • Workspace paint gate: 9/20 to 20/20 under 2 seconds
  • Resolve p50: 914.5 ms to 751.6 ms (17.8% faster)
  • Resolve p95: 1158.5 ms to 762.6 ms (34.2% faster)
  • Paint p50: 2164.3 ms to 1828.2 ms (15.5% faster)
  • Paint p95: 2262.0 ms to 1860.1 ms (17.8% faster)
  • Exact Explorer model/rows/DOM binding: 20/20

The product-neutral regression records 65,664 planner lookups on the old path and zero on the direct path, with the same 128 cascades and computed styles.

Validation

  • webscene_native_direct_subject_invalidation: passed
  • attribute-invalidation-scope: passed
  • nested-functional-selectors: passed
  • relative-sibling-has: passed
  • AppScene SDK producer tests: 31/31 passed
  • macOS compiler/runtime profile: passed
  • Release app codesign verification: passed
  • Unchanged Code OSS exact product gate: 20/20 passed

The broad existing filters still contain unrelated baseline failures: live-form-state counts both the invalid form and control, and broader invalidation scaling has existing memory/tree-reaction ceilings. This PR does not change those paths.

Detailed evidence: docs/validation/direct-subject-selector-invalidation-243.md

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