Skip to content

[Performance] Avoid visibility reads for non-default focusable candidates - #611

Open
andreivms wants to merge 1 commit into
microsoft:masterfrom
andreivms:user/andreivms/perf-tabster-search-cost-local
Open

andreivms wants to merge 1 commit into
microsoft:masterfrom
andreivms:user/andreivms/perf-tabster-search-cost-local

Conversation

@andreivms

@andreivms andreivms commented Nov 5, 2026 •

Copy link
Copy Markdown

Summary

Check the live isDefault flag before expensive focusability geometry when finding a default element. Unmarked candidates cannot be the answer, so they do not need those reads.

This is a live predicate reorder, not a cache or traversal rewrite. Visibility/accessibility checks still run for actual default candidates, and live property changes remain observable.

Evidence chain

Public Mover/findDefault search context
-> source performs geometry before a cheap live default-flag rejection
-> generic real table/default-query reproductions expose unnecessary reads
-> reject non-default candidates before geometry without caching or changing traversal

Implicated stacks during unresponsive renderer

Public Mover, findDefault and context/virtual-parent traversal establish the search context. The dominant context/traversal work is not reduced by this change; no entire-workload or renderer-unresponsive causal claim is made.

Baseline result

  • A 15-cell table default query with no default candidate: 15 style plus 15 rectangle reads -> zero; its null result is unchanged.
  • Trusted keyboard entry into the table: 61 style plus 61 rectangle reads -> one plus one.
  • Walkers, filters and virtual-parent calls remain 5 / 94 / 662.
  • Focus results and the exercised keyboard sequences are unchanged.

Geometry API reads can be cached browser work. They are not forced-layout counts or measured production CPU savings.

Scope and limits

  • Regression coverage includes live defaults, hidden/disabled/fieldset/programmatic/shadow/modal/root modes and real keyboard/DOM behavior.
  • No cross-query cache, dependency or public-type change is introduced.
  • This independent change does not contain the backward-enumeration repair.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 37912007-07c2-40e4-81bd-df708aa99fe2

This branch has not been deployed

No deployments
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