Repository navigation
chore: spike simulated throttling for soft navigations - #29
Open
ChristopherPHolder wants to merge 2 commits into
Open
ChristopherPHolder wants to merge 2 commits into
ChristopherPHolder wants to merge 2 commits into
Conversation
A private workspace package that prototypes the Lantern changes from docs/simulated-throttling.md and measures them against DevTools throttling, on a fixture with 8 scenarios and on 4 public sites. Changes 1 to 3 hold and are needed together, with two additions: the pruning of short tasks has to wait for the new links, and the paint graph has to include every task that ran before the paint. Warm connections (change 4) make the result worse against DevTools throttling. Closes #28
…d results - record.mjs installs the `all` configuration explicitly, which the README compares the step's audits with. - evaluate.mjs and report.mjs reject configuration names they do not know. - The root is the task at the input time, not the click task, which is usually pruned. Comments and README say so. - The HTTP/2 rule turns multiplexing off for the whole simulation step, so overflow bytes of the previous request are not counted toward the next. - The per-target tables count the runs that failed next to the median. The recordings were lost with the worktree, so both sets are re-recorded and the README numbers updated. The HTTP/2 fix changes none of the 540 values on these recordings.
ChristopherPHolder
force-pushed
the
spike/simulated-throttling
branch
from
November 19, 2026 11:11
ba6fde1 to
29b84af
Compare
This branch has not been deployed
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.
Closes #28. Background for #23.
What
A private workspace package,
packages/simulated-throttling-spike, that prototypes the Lantern changes fromdocs/simulated-throttling.mdand measures them against DevTools throttling. It doesn't change the published package, which keeps requiringdevtoolsorprovided. The README has the results and the method.src/lantern/) replace Lantern functions at runtime, in the Lantern Lighthouse imports, so Lighthouse's own audits use them. Each one can be switched on its own:fetchchains from thev8::Debugger::AsyncTaskScheduledflows (3)src/app/server.mjs): 8 scenarios. Sequential and parallelfetches, an image as LCP, a long task, a lazily loaded chunk, an API on a cold origin, XHR, and HTTP/2.src/real-apps.mjs): react.dev, angular.dev, vite.dev and svelte.dev.record.mjs,evaluate.mjsandreport.mjs, with the results committed inresults/. Each soft navigation is recorded undersimulateand underdevtools, each in a fresh browser, 3 runs each.docs/simulated-throttling.mdgets a paragraph pointing to the spike.Results
Median absolute error against DevTools throttling:
linkCPUNodesprunes tasks under 10 ms before the new links could be added. A soft navigation's tasks are almost all that short, so the pruning has to run after the links.performance.now()isn't slowed down by CPU throttlingVerified
simulatestep's audits compute and report a Performance score. Their values match whatevaluate.mjscomputes for the same configuration, all 180 of them.pnpm nx run-many -t lint test -p simulated-throttling-spike lighthouse-soft-navigationpasses: 16 tests in the spike, 79 in the package.pnpm nx format:checkandpnpm nx affected -t lint test build typecheckpass.record.mjsinstalling theallconfiguration explicitly. The HTTP/2 rule's fix in the second commit changes none of the 540 values on them.nx releaseor the e2e registry.Related: #27 corrects change 3 in the doc. This PR only adds a paragraph to another section, so the two don't conflict.