Repository navigation
Conversation
Samples the main-thread stalls of WebKit pages on Linux CI, while idle after rendering a million rows and during the WebKit suite, alongside the memory of WebKit's web processes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
nstepien
added a commit
that referenced
this pull request
Oct 25, 2026
The "should expand a group with more rows than a function call can take
as arguments" test renders a million rows, which is far more work for
WebKit than for other browsers. DataGrid declares one grid row track per
row (`repeat(${rows.length}, …px)` in `useViewportRows`), and WebKit
lays out each track, while Chromium handles the `repeat()` as a whole.
Measured locally:
| | WebKit | Chromium |
| ----------------------------- | --------: | -------: |
| One layout, 100k rows | 18–19 ms | ~1 ms |
| One layout, 1M rows | ~250 ms | ~1 ms |
| Mounting the grid, 1M rows | 913 ms | 61 ms |
| Memory of the page's process | +1.1 GB | small |
About 0.6 GB of that memory stays committed after the grid unmounts, for
the rest of the page's life, and pages run several test files. In CI,
the test takes 2.5–5.4 s in WebKit.
The only WebKit flake in CI since October 19, the focus click in
`test/setupBrowser.ts` timing out in [run
40029118938](https://github.com/Comcast/react-data-grid/actions/runs/40029118938/attempts/1),
came from the test that ran right after this one: replaying the run's
seed shows the order. The page didn't respond for over 2 s, after the
grid had already unmounted. A Linux CI experiment in #4234 didn't
reproduce that stall, but showed that this test blocks its page's main
thread for 2.9–3.6 s, by far WebKit's longest stall in the suite (the
next longest take 0.5–1.6 s), and that pages don't stall while idle
afterwards. Locally, two other pages stalled for over 2 s in tests that
didn't follow this one, so this change may not remove every stall. It
does remove WebKit's longest main-thread block, and the memory that test
leaves behind.
The test still runs in Chromium and Firefox. It guards against spreading
the rows into a function call, which doesn't depend on the browser, and
their argument limits (123,758 and 500,000) are well below a million.
Separately, the same layout cost slows scrolling in WebKit with many
rows: 186–230 ms per scroll step at 1M rows and 30–44 ms at 100k,
against 8–15 ms in Chromium. That's worth its own issue.
`vp run ci` passes.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.
Experiment, not to be merged. Follows up on #4232: why does a WebKit page stop responding for seconds on Linux CI?
In run 40029118938, the focus click in
test/setupBrowser.tstimed out while Playwright waited for the page itself, right after the million-rowTreeDataGridtest, and after that grid had unmounted. That test bloats WebKit's web process by ~1.1 GB, and ~0.6 GB stays committed afterwards. One hypothesis is Linux WebKit's memory-pressure handling, which would release memory on the page's main thread every so often. Locally, Windows WebKit pages also stalled for over 2 s twice, in tests that didn't follow the million-row test.The
WebKit stall experimentworkflow runs three times, each with:zzStall.experiment.tsx: renders a million rows, then idles for 65 s, then does the same with 100k rows as a control.Both steps load
test/zzStallSampler.ts, which records every main-thread stall over 100 ms in each page, with wall-clock times and the test that was running, and prints them once per file asSTALLS {…}. A background loop samples the RSS of WebKit's web processes every 200 ms, with millisecond timestamps. The logs are uploaded as artifacts.Reading it:
The regular CI workflow doesn't set the experiment's environment variables, so it runs as usual.
Results
virtualization.test.ts's tests with virtualization disabled.🤖 Generated with Claude Code