Repository navigation
Website: make switching selectors fast - #2491
Merged
Merged
Conversation
Every click on a selector rebuilt the whole "Detailed Comparison" table (20k-75k cells), and laying it out took most of the time: ~0.5 s per click on the main page, ~0.25 s on the hardware page, ~1.3 s on the versions page. - The details table is virtualized: column widths and row heights are measured once on a table with all header cells and a single row of the widest cells, then fixed; only the cells within a screen of the viewport are rendered, and the edges are updated incrementally while scrolling. The widths are measured again when web fonts finish loading. - The details table is rebuilt after the summary is painted, so the click responds right away; a scroll before that rebuilds it immediately. - Avoid forced synchronous layouts: textContent instead of innerText for the selectors, and don't rewrite --qn-left on the versions page unless it changes. - Hoist per-cell baseline computations out of loops; cheaper selectRun on the versions page. The rendering is pixel-identical to the previous version. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Member
Author
|
Preview of the main benchmark page from this PR: |
Member
Author
|
Yes, it is faster. |
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.
Switching selectors on the benchmark pages (main, hardware, versions) had a noticeable lag: every click rebuilt the whole "Detailed Comparison" table (20k–75k cells), and the browser spent most of the time laying it out.
Changes
table-layout: fixed+<colgroup>). Only the cells within a screen of the viewport are rendered, and the edges are updated incrementally while scrolling. Widths are measured again when web fonts finish loading.textContentreplacesinnerTextin selector loops.--qn-lefton the versions page is no longer rewritten (and the table no longer re-measured) on every render.selectRunon the versions page is cheaper.Measurements (headless Chromium, 1600×1000)
Verification
Trade-offs
🤖 Generated with Claude Code