Skip to content

perf(site): cut forced style recalcs on load - #62421

Merged
adamdotdevin merged 3 commits into
devfrom
site-strobe
Nov 6, 2026
Merged

adamdotdevin merged 3 commits into
devfrom
site-strobe

Conversation

@adamdotdevin

Copy link
Copy Markdown
Member

Issue for this PR

Closes #

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Two places forced extra full-page style recalculations while the home page hydrates:

  • Banner (site-banner.tsx): its scroll handler ran on mount and wrote --banner-scroll on the site root (an inherited custom property, so the whole page restyles), then read layout straight after the write. A page loaded at the top now writes nothing (unset already reads as 0px through the CSS fallback), unchanged values aren't rewritten, and the reads come before the write.
  • Console dots (console-field.tsx): the dot mask was drawn from an effect on mount (forcing a layout) and again in the resize observer's first callback. The observer's callback is now the first draw; it runs after layout and before that frame paints, so the dots appear in the same frame as before.

Also adds strobe benches for the site (services/site/perf/site.bench.ts, perf/serve.ts, services/site/strobe.json), @hona/strobe as a site devDependency, and sourcemap: "hidden" for client builds only when strobe sets STROBE_SOURCEMAP=hidden. All of that is dev-only: production builds and the scripts they ship are unchanged.

Discovery: strobe bench services/site/perf/site.bench.ts --check --why always --headless, then strobe query <rec> layout on the home load. That showed about 10 forced style recalcs per load, with site-banner.tsx:73 (scrollY after the write) and console-field.tsx:22 (clientWidth) among them.

How did you verify your code works?

  • Paired strobe A/Bs, headless Chromium on an 8-vCPU exe.dev VM. The blocks below are strobe's output, verbatim. Banner: load / main-thread work −5.4% desktop, −5.9% phone; scroll unchanged. Console dots: load / −2.6% desktop; phone underpowered.
  • The "late frames" cautions in the blocks come from a headless run where frame metrics aren't meaningful (strobe flags the same thing on the live-site target, which is identical on both sides). I've reported it to strobe; ignore them here.
  • Full parity (site-qa/parity.ts, 53 routes × 3 viewports with forced states) against origin/dev: no differences beyond the documented logo-wall timing noise (/ja, /de, which also needed retries base-vs-base).
  • bun typecheck, bun run typecheck:tsc, bun test in services/site; root bun run check; the build's bundle and CSS checks.

Visual

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 72" width="240" height="72" fill="currentColor">
  <style>
    .bar { transform-box: fill-box; transform-origin: left center; animation: cut 3.2s ease-in-out infinite; }
    .b2 { animation-delay: .15s; }
    .b3 { animation-delay: .3s; }
    @keyframes cut { 0%, 25% { transform: scaleX(1); } 55%, 90% { transform: scaleX(.78); } 100% { transform: scaleX(1); } }
    @media (prefers-reduced-motion: reduce) { .bar { animation: none; transform: scaleX(.78); } }
  </style>
  <rect x="24" y="14" width="192" height="10" rx="3" opacity=".12"/>
  <rect x="24" y="31" width="192" height="10" rx="3" opacity=".12"/>
  <rect x="24" y="48" width="192" height="10" rx="3" opacity=".12"/>
  <rect class="bar" x="24" y="14" width="176" height="10" rx="3" opacity=".7"/>
  <rect class="bar b2" x="24" y="31" width="150" height="10" rx="3" opacity=".5"/>
  <rect class="bar b3" x="24" y="48" width="120" height="10" rx="3" opacity=".35"/>
</svg>

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

strobe · exp_4c3ca9 · services/site/perf/site.bench.ts · generated

5.4–5.9% less main-thread work

Caution

Regression: late frames rose from 23.5% to 31.6% in Load home (desktop) (3 of 3 pairs)
Regression: late frames rose from 31.9% to 39.1% in Load home (phone) (7 of 10 pairs)
Regression: late frames rose from 20.1% to 22.2% in Scroll home (desktop) (17 of 26 pairs)

Load home (desktop): Main-thread work per 973 ms run −5.4% per pair (medians 535 → 508 ms), better in 8 of 8 pairs, likely −9.8% to −3.5%.

Load home (phone): Main-thread work per 1 s run −5.9% per pair (medians 669 → 617 ms), better in 10 of 12 pairs, likely −11% to 0.0%, perhaps by under 2%; unsteady case: its work grew each run.

Scroll home (desktop): Main-thread work per 2.1 s run: no clear change in 26 pairs (medians 701 → 692 ms); ~46 pairs would settle it.

Measured in a headless browser (no display): CPU and counters only; compare only with other headless runs.

Details · metrics, pairs, profiles, method

Metrics

Metric Before This PR Change Likely range Verdict
Load home (desktop)
Main-thread work per run main 535 ms 508 ms −5.4% −9.8% to −3.5% less
Main-thread busy time 55.2% 52.2% −5.5% −8.4% to −4.1% less
Total CPU use 103% 102% −1.7% −7.2% to +1.9% inconclusive ~57 pairs
Load home (phone)
Main-thread work per run main 669 ms 617 ms −5.9% −11% to 0.0% less
Main-thread busy time 65.1% 60.7% −5.7% −7.3% to −3.8% less
Scroll home (desktop)
Main-thread work per run main 701 ms 692 ms −1.1% −2.6% to +0.5% inconclusive ~46 pairs
Main-thread busy time 33.3% 32.8% −1.3% −2.5% to 0.0% inconclusive
Total CPU use 168% 162% −3.0% −5.5% to +0.1% inconclusive

Likely range: 98.4% confidence for the main metric, 96.1% for the others. Change: the median of the pairs' own changes.

Pairs

Pair Main metric, before → this PR Change
Load home (desktop)
1 AB 598 → 554 ms −7.4%
2 BA 537 → 509 ms −5.3%
3 AB 534 → 516 ms −3.4%
4 BA 524 → 506 ms −3.5%
5 AB 534 → 510 ms −4.5%
6 BA 554 → 487 ms −12%
7 AB 536 → 506 ms −5.5%
8 BA 534 → 504 ms −5.8%
Load home (phone)
1 AB 637 → 696 ms +9.3%
2 BA 659 → 663 ms +0.6%
3 AB 663 → 604 ms −9.0%
4 BA 675 → 623 ms −7.7%
5 AB 620 → 604 ms −2.6%
6 BA 613 → 593 ms −3.4%
7 AB 627 → 591 ms −5.7%
8 BA 685 → 595 ms −13%
9 AB 680 → 675 ms −0.6%
10 BA 699 → 636 ms −9.0%
11 AB 693 → 619 ms −11%
12 BA 701 → 615 ms −12%
Scroll home (desktop)
1 AB 712 → 727 ms +2.0%
2 BA 679 → 735 ms +8.3%
3 AB 709 → 711 ms +0.2%
4 BA 701 → 689 ms −1.7%
5 AB 727 → 690 ms −5.1%
… 16 more pairs: medians 702 → 693 ms −1.2% median
22 BA 695 → 668 ms −3.9%
23 AB 699 → 691 ms −1.1%
24 BA 710 → 722 ms +1.7%
25 AB 680 → 657 ms −3.3%
26 BA 715 → 711 ms −0.5%

Each pair launched both builds fresh, in alternating order (AB or BA). Change: the main metric. The … row of Scroll home (desktop) sums up pairs 6–21: this PR did better in 10 of 16; the middle 80% of their changes ran from −4.7% to +2.6%.

Frame pacing: Load home (desktop)

60 Hz display Before This PR
On time 73.11% 65.77%
One frame late 8.56% 11.74%
Two or more late 18.34% 22.48%
Frame gap, p50 16.8 ms 17.1 ms
Frame gap, p95 131 ms 118 ms
Frame gap, p99 278 ms 220 ms
Longest frame gap 307 ms 281 ms

Shares of all 409 and 298 gaps between frames; a frame is late from 1.5 frame times. Gap percentiles: each launch's own, median across launches.

Frame pacing: Load home (phone)

60 Hz display Before This PR
On time 66.76% 59.28%
One frame late 9.92% 14.52%
Two or more late 23.32% 26.20%
Frame gap, p50 17.1 ms 17.4 ms
Frame gap, p95 269 ms 236 ms
Frame gap, p99 307 ms 266 ms
Longest frame gap 349 ms 282 ms

Shares of all 746 and 668 gaps between frames; a frame is late from 1.5 frame times. Gap percentiles: each launch's own, median across launches.

Frame pacing: Scroll home (desktop)

60 Hz display Before This PR
On time 79.87% 77.83%
One frame late 13.31% 15.22%
Two or more late 6.83% 6.95%
Frame gap, p50 16.7 ms 16.7 ms
Frame gap, p95 66.9 ms 66.9 ms
Frame gap, p99 84.0 ms 84.0 ms
Longest frame gap 134 ms 133 ms

Shares of all 11,513 and 11,374 gaps between frames; a frame is late from 1.5 frame times. Gap percentiles: each launch's own, median across launches.

Where it came from, in profiled launches

Main thread, per run Before This PR
Load home (desktop)
All work 535 ms 508 ms
JavaScript 24.4 ms 24.4 ms
Style 297 ms 266 ms
Layout 33.9 ms 33.2 ms
GC pauses, profiled 11.5 ms 12.2 ms
Memory freed by GC, profiled 4.7 MB 5.1 MB
Load home (phone)
All work 669 ms 617 ms
JavaScript 40.8 ms 40.5 ms
Style 369 ms 324 ms
Layout 31.3 ms 31.6 ms
GC pauses, profiled 16.2 ms 14.4 ms
Memory freed by GC, profiled 6.4 MB 5.7 MB
Function File What, per run Before This PR Change
Load home (desktop)
r site.js CPU time 68.6 ms 0 ms −68.6 ms
n site.js CPU time 32.8 ms 0.819 ms −32.0 ms
r site.js CPU time 28.5 ms 0.0590 ms −28.4 ms
a index.js CPU time 14.9 ms 0 ms −14.9 ms
(V8 API) (native) Allocated 141 KB 77 KB −64 KB
Load home (phone)
r site.js CPU time 72.6 ms 0 ms −72.6 ms
n site.js CPU time 40.7 ms 0.916 ms −39.7 ms
(V8 API) (native) Allocated 187 KB 83 KB −104 KB

From one profiled launch per build (rec_6fa396 → rec_d69158, rec_9d4147 → rec_dcf979), apart from the timed pairs: only what moved the way a decided change did, to explain it. Profiling slows a launch, so read these as directions, not as changes.

How it was measured

  • Before: origin/dev@e9540d35d4, fix(core): stop waiting on the Console before prompts
  • This PR: dfe7fec2ae, perf(site): stop the banner's scroll handler forcing a page restyle
  • Machine: Ubuntu 24.04.5 LTS, kernel 6.12.115, EPYC 9554P, ANGLE (Google, Vulkan 1.3.0 (SwiftShader Device (Subzero) (0x0000C0DE)), SwiftShader driver-5.0.0), no cpufreq power plan, Chrome 151.0.7922.34, headless browser (no display), not pinned (no V-Cache CCD)
  • On screen, Load home (desktop): 'OpenCode | The open source coding agent for any model · The open source coding agent · Products' → '/'
  • On screen, Load home (phone): 'OpenCode | The open source coding agent for any model · The open source coding agent · Products' → '/'
  • On screen, Scroll home (desktop): 'OpenCode | The open source coding agent for any model · The open source coding agent · Products'
  • Method: fresh launches in alternating pairs; Wilcoxon signed-rank test and Hodges–Lehmann interval; main metric checked at 8, 12, 18, 26, 40 pairs, others Holm-corrected; 26.2 min in all
  • VirtualMachine: running in a virtual machine (hypervisor): its timings move with the host's load; prefer bare metal
  • Stale calibration: no calibration on this device yet: the Throttled check has no baseline (run strobe up)
  • Rerun: earlier experiments on these same variants ran another bench file, harness, case, primary, margin or flags (the ledger names them): a verdict reached…
  • Power plan: no cpufreq (kept: no frequency policy to switch, as in most virtual machines)
  • OverheadBudget: load-home · desktop · this PR block: the sampler used 0.70% of a core, over its 0.5% budget (SPEC §19)
  • OverheadBudget: load-home · phone · this PR block: the sampler used 0.74% of a core, over its 0.5% budget (SPEC §19)
  • Unmapped scripts (Load home (desktop), Load home (phone)): before: 100% of script samples have no source map, so their names and files stay minified; strobe builds with STROBE_SOURCEMAP=hidden: let the bundler…
  • Unmapped scripts (Load home (desktop), Load home (phone)): this PR: 100% of script samples have no source map, so their names and files stay minified; strobe builds with STROBE_SOURCEMAP=hidden: let the bundler…
  • Unsteady warmup (Load home (phone)): 1 block(s) never did the same work twice in 10 warmup runs: the case's state grows across runs; add a reset
  • Drift (Load home (phone)): the difference trends across pairs (Spearman -0.68): the machine changed during the run
  • Other experiments on these builds: 2nd experiment on these variants; earlier: exp_840dd0 less (production: chromium ~/.cache/ms-playwright/chromium-1234/chrome-linux64/chrome@290614600-1793535401 headless → none; --target unset → desktop,phone)
  • Recorded with strobe 0.14.0, formatted with strobe 0.14.0+ca51045101

Also measured, not tested

Metric Before This PR Change Likely range
Load home (desktop)
JavaScript time per run 24.4 ms 24.4 ms −2.2% medians +0.1% −5.5% to +6.2%
Layout time per run 33.9 ms 33.2 ms −2.2% −9.4% to +10%
Style time per run 297 ms 266 ms −10% −12% to −8.0%
Layouts per run 8 8 0 −0.5 to +0.5
Style recalculations per run 38.5 37 −1 −4.5 to +0.5
Run time 973 ms 974 ms +0.1% −1.0% to +1.0%
Renderer CPU use 75.3% 73.8% −3.4% −6.5% to 0.0%
GPU process CPU use 4.36% 4.02% −6.4% −33% to +11%
Browser process CPU use 16.1% 16.3% +2.0% −4.8% to +5.7%
App memory 774 MB 784 MB +1.5% −16% to +20%
CPU time per run 994 ms 1.00 s −1.4% medians +0.7% −9.4% to +2.4%
Load home (phone)
JavaScript time per run 40.8 ms 40.5 ms −0.3% −4.7% to +4.1%
Layout time per run 31.3 ms 31.6 ms −0.1% −9.9% to +8.7%
Style time per run 369 ms 324 ms −12% −14% to −7.7%
Layouts per run 12 12 0 0 to +0.5
Style recalculations per run 57 56.5 0 −0.5 to +2
Run time 1.03 s 1.02 s −0.6% −3.1% to +1.9%
Renderer CPU use 90.4% 89.3% −1.6% −3.7% to +0.4%
GPU process CPU use 12.3% 12.4% −4.5% medians +0.6% −31% to +35%
Browser process CPU use 17.1% 17.4% +0.7% −4.3% to +5.6%
App memory 890 MB 937 MB −0.2% medians +5.3% −12% to +14%
Total CPU use 133% 127% −2.3% −5.7% to +1.0%
CPU time per run 1.36 s 1.27 s −2.4% −7.6% to +4.4%
Scroll home (desktop)
JavaScript time per run 62.4 ms 61.5 ms −0.3% −4.2% to +3.2%
Layout time per run 5.73 ms 5.69 ms −0.8% −2.9% to +1.7%
Style time per run 435 ms 434 ms −0.3% −1.3% to +0.7%
Layouts per run 49.5 48 −2 −5 to +1
Style recalculations per run 95.5 93 −2 −5 to +1
Run time 2.11 s 2.11 s +0.1% 0.0% to +0.3%
Renderer CPU use 152% 146% −3.5% −6.3% to −0.7%
GPU process CPU use 11.7% 11.7% −0.4% −2.8% to +2.0%
Browser process CPU use 2.73% 2.72% −0.3% −3.1% to +3.2%
App memory 507 MB 498 MB −1.7% −2.5% to −1.2%
JavaScript heap 20.1 MB 22.0 MB −0.1% medians +9.6% −8.9% to +9.8%
CPU time per run 3.54 s 3.41 s −2.8% −5.5% to +0.3%

Unchanged: DOM nodes (3, 1534), JavaScript heap (0.600 MB). Uneven pairs: JavaScript time per run in Load home (desktop) read 22.2–26.7 ms before and 22.4–26.6 ms with this PR, CPU time per run in Load home (desktop) read 989 ms–1.14 s before and 912 ms–1.10 s with this PR, GPU process CPU use in Load home (phone) read 10.4–21.3% before and 9.25–21.9% with this PR, app memory in Load home (phone) read 791–1222 MB before and 813–1063 MB with this PR and JavaScript heap in Scroll home (desktop) read 9.96–24.7 MB before and 9.97–22.6 MB with this PR; the medians' change (beside it) and the pairs' own point different ways, as when a few launches read far from the rest, so read neither as the change.

Rerun · command and recordings
strobe bench services/site/perf/site.bench.ts \
  --base origin/dev \
  --head dfe7fec2ae \
  --filter load-home,scroll-home \
  --headless \
  --max-time 30m \
  --target desktop,phone
# to settle Scroll home (desktop) (~46 pairs), add: --filter scroll-home --pairs 46
  • Full report: strobe report experiment exp_4c3ca9 --open
  • Timeline and flame graphs: strobe open exp_4c3ca9/head, strobe open exp_4c3ca9/base
  • Kept launches, Load home (desktop): rec_75a3e2 (before, pair 1), rec_e257b1 (this PR, pair 1)
  • Kept launches, Load home (phone): rec_f6dc71 (before, pair 1), rec_21eb7a (this PR, pair 1)
  • Kept launches, Scroll home (desktop): rec_a31dcf (before, pair 1), rec_a1b93e (this PR, pair 1)

strobe · exp_4c3ca9 · end of generated report

strobe · exp_441606 · services/site/perf/site.bench.ts · generated

2.6% less main-thread work

Caution

Regression: late frames rose from 35.3% to 38.7% in Load home (phone) (5 of 11 pairs)

Load home (desktop): Main-thread work per 797 ms run −2.6% per pair (medians 494 → 477 ms), better in 10 of 12 pairs, likely −4.2% to −1.0%, perhaps by under 2%.
But GPU process CPU use +17% and JavaScript time per run +8.2% (not tested).

Load home (phone): Main-thread work per 909 ms run: no clear change in 18 pairs (medians 589 → 581 ms); ~118 pairs would settle it.
But JavaScript time per run +5.4% (not tested).

Measured in a headless browser (no display): CPU and counters only; compare only with other headless runs.

Details · metrics, pairs, profiles, method

Metrics

Metric Before This PR Change Likely range Verdict
Load home (desktop)
Main-thread work per run main 494 ms 477 ms −2.6% −4.2% to −1.0% less
Main-thread busy time 61.1% 63.6% +0.9% −3.0% to +4.2% inconclusive ~122 pairs
Load home (phone)
Main-thread work per run main 589 ms 581 ms −1.5% −4.7% to +1.7% inconclusive ~118 pairs
Main-thread busy time 65.2% 64.3% −0.8% −1.8% to +0.4% inconclusive

Likely range: 98.8% confidence for the main metric, 95.8% for the others. Change: the median of the pairs' own changes.

Pairs

Pair Main metric, before → this PR Change
Load home (desktop)
1 AB 494 → 470 ms −5.0%
2 BA 493 → 473 ms −4.0%
3 AB 482 → 469 ms −2.7%
4 BA 493 → 480 ms −2.6%
5 AB 500 → 496 ms −0.8%
6 BA 495 → 483 ms −2.4%
7 AB 478 → 481 ms +0.5%
8 BA 497 → 497 ms +0.2%
9 AB 486 → 469 ms −3.5%
10 BA 486 → 475 ms −2.1%
11 AB 494 → 475 ms −3.8%
12 BA 504 → 479 ms −4.9%
Load home (phone)
1 AB 572 → 598 ms +4.4%
2 BA 579 → 570 ms −1.6%
3 AB 587 → 555 ms −5.5%
4 BA 571 → 572 ms +0.2%
5 AB 610 → 583 ms −4.4%
6 BA 630 → 643 ms +2.2%
7 AB 590 → 612 ms +3.7%
8 BA 588 → 569 ms −3.2%
9 AB 580 → 598 ms +3.1%
10 BA 564 → 595 ms +5.5%
11 AB 561 → 555 ms −1.0%
12 BA 610 → 610 ms −0.1%
13 AB 622 → 570 ms −8.4%
14 BA 636 → 569 ms −10%
15 AB 621 → 613 ms −1.3%
16 BA 604 → 581 ms −3.8%
17 AB 568 → 577 ms +1.6%
18 BA 640 → 582 ms −9.0%

Each pair launched both builds fresh, in alternating order (AB or BA). Change: the main metric.

Frame pacing: Load home (desktop)

60 Hz display Before This PR
On time 66.03% 68.80%
One frame late 11.00% 8.47%
Two or more late 22.97% 22.73%
Frame gap, p50 16.9 ms 16.8 ms
Frame gap, p95 111 ms 139 ms
Frame gap, p99 228 ms 207 ms
Longest frame gap 250 ms 218 ms

Shares of all 418 and 484 gaps between frames; a frame is late from 1.5 frame times. Gap percentiles: each launch's own, median across launches.

Frame pacing: Load home (phone)

60 Hz display Before This PR
On time 62.39% 57.56%
One frame late 12.72% 15.66%
Two or more late 24.89% 26.78%
Frame gap, p50 17.5 ms 17.5 ms
Frame gap, p95 234 ms 221 ms
Frame gap, p99 256 ms 243 ms
Longest frame gap 267 ms 257 ms

Shares of all 904 and 926 gaps between frames; a frame is late from 1.5 frame times. Gap percentiles: each launch's own, median across launches.

Where it came from, in profiled launches

Main thread, per run Before This PR
Load home (desktop)
All work 494 ms 477 ms
JavaScript 23.6 ms 25.1 ms
Style 263 ms 252 ms
Layout 33.8 ms 32.4 ms
GC pauses, profiled 12.0 ms 11.5 ms
Memory freed by GC, profiled 5.1 MB 5.0 MB
Function File What, per run Before This PR Change
Load home (desktop)
a index.js CPU time 29.3 ms 0 ms −29.3 ms

From one profiled launch per build (rec_da1711 → rec_da72db), apart from the timed pairs: only what moved the way a decided change did, to explain it. Profiling slows a launch, so read these as directions, not as changes.

How it was measured

  • Before: 170d9ed4bf, perf(site): write a fixed mark's surface only when it changes
  • This PR: 04eee9d30b, perf(site): draw the Console dots once when the field mounts
  • Machine: Ubuntu 24.04.5 LTS, kernel 6.12.115, EPYC 9554P, ANGLE (Google, Vulkan 1.3.0 (SwiftShader Device (Subzero) (0x0000C0DE)), SwiftShader driver-5.0.0), no cpufreq power plan, Chrome 151.0.7922.34, headless browser (no display), not pinned (no V-Cache CCD)
  • On screen, Load home (desktop): 'OpenCode | The open source coding agent for any model · The open source coding agent · Products' → '/'
  • On screen, Load home (phone): 'OpenCode | The open source coding agent for any model · The open source coding agent · Products' → '/'
  • Method: fresh launches in alternating pairs; Wilcoxon signed-rank test and Hodges–Lehmann interval; main metric checked at 8, 12, 18, 26, 40 pairs, others Holm-corrected; 12.1 min in all
  • VirtualMachine: running in a virtual machine (hypervisor): its timings move with the host's load; prefer bare metal
  • Stale calibration: no calibration on this device yet: the Throttled check has no baseline (run strobe up)
  • Power plan: no cpufreq (kept: no frequency policy to switch, as in most virtual machines)
  • OverheadBudget: load-home · desktop · before block: the sampler used 0.70% of a core, over its 0.5% budget (SPEC §19)
  • OverheadBudget: load-home · phone · this PR block: the sampler used 0.67% of a core, over its 0.5% budget (SPEC §19)
  • Unmapped scripts (Load home (desktop)): before: 100% of script samples have no source map, so their names and files stay minified; strobe builds with STROBE_SOURCEMAP=hidden: let the bundler…
  • Unmapped scripts (Load home (desktop)): this PR: 100% of script samples have no source map, so their names and files stay minified; strobe builds with STROBE_SOURCEMAP=hidden: let the bundler…
  • Recorded with strobe 0.14.0, formatted with strobe 0.14.0+ca51045101

Also measured, not tested

Metric Before This PR Change Likely range
Load home (desktop)
JavaScript time per run 23.6 ms 25.1 ms +8.2% +4.8% to +16%
Layout time per run 33.8 ms 32.4 ms +0.4% medians −4.1% −6.6% to +7.4%
Style time per run 263 ms 252 ms −4.4% −5.9% to −2.9%
Layouts per run 8 8 0 −0.5 to 0
Style recalculations per run 37 37 0 −2 to +1.5
Run time 797 ms 758 ms −3.8% −5.9% to −1.7%
Renderer CPU use 85.5% 85.8% +1.7% −3.1% to +5.3%
GPU process CPU use 4.21% 5.02% +17% +2.2% to +57%
Browser process CPU use 19.0% 19.6% +3.5% +0.7% to +6.6%
App memory 858 MB 834 MB +0.8% medians −2.8% −11% to +8.8%
Total CPU use 118% 121% +2.6% −0.7% to +5.4%
CPU time per run 925 ms 942 ms +0.5% −2.0% to +2.4%
Load home (phone)
JavaScript time per run 38.7 ms 40.6 ms +5.4% +2.2% to +8.2%
Layout time per run 28.9 ms 29.0 ms −1.8% medians +0.4% −6.3% to +4.7%
Style time per run 318 ms 307 ms −2.7% −5.6% to −0.2%
Layouts per run 12 12 0 0 to +0.5
Style recalculations per run 56 56 +1 0 to +3
Run time 909 ms 898 ms −0.5% −2.4% to +1.1%
Renderer CPU use 92.8% 93.6% +0.2% −1.3% to +2.0%
GPU process CPU use 11.1% 11.4% +4.1% −16% to +40%
Browser process CPU use 18.4% 18.7% +1.5% −1.0% to +4.3%
App memory 837 MB 879 MB +3.2% −6.2% to +13%
Total CPU use 133% 133% +0.8% −1.1% to +2.6%
CPU time per run 1.19 s 1.19 s +0.5% −3.9% to +2.7%

Unchanged: DOM nodes (3), JavaScript heap (0.600 MB). Uneven pairs: layout time per run in Load home (desktop) read 27.6–35.9 ms before and 29.9–37.8 ms with this PR, app memory in Load home (desktop) read 754–1094 MB before and 723–1141 MB with this PR and layout time per run in Load home (phone) read 25.9–35.0 ms before and 26.4–32.1 ms with this PR; the medians' change (beside it) and the pairs' own point different ways, as when a few launches read far from the rest, so read neither as the change.

Rerun · command and recordings
strobe bench services/site/perf/site.bench.ts \
  --base 170d9ed4bf \
  --head 04eee9d30b \
  --filter load-home \
  --headless \
  --max-time 25m \
  --target desktop,phone
# to settle Load home (phone) (~118 pairs), add: --filter load-home --pairs 118
  • Full report: strobe report experiment exp_441606 --open
  • Timeline and flame graphs: strobe open exp_441606/head, strobe open exp_441606/base
  • Kept launches, Load home (desktop): rec_e2309b (before, pair 1), rec_abd4c2 (this PR, pair 1)
  • Kept launches, Load home (phone): rec_b3d2ea (before, pair 1), rec_e25116 (this PR, pair 1)

strobe · exp_441606 · end of generated report

…the top

The scroll handler wrote --banner-scroll on the site root on mount and on every scroll event, then read layout right after the write. A page loaded at the top now writes nothing (unset reads as 0px), unchanged values aren't rewritten, and the reads come first. strobe: load-home main.work -5.4% desktop, -5.9% phone (exp_4c3ca9); scroll unchanged.
The field drew its dot mask from an effect on mount (forcing a layout) and again from the resize observer's first callback. The observer's callback is now the first draw, before the same frame paints. strobe: load-home main.work -2.6% desktop (exp_441606); phone underpowered.
@adamdotdevin
adamdotdevin enabled auto-merge (squash) November 6, 2026 20:30

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't find anything that should block this. I couldn't run it in a browser (none available here), so the strobe numbers aren't reproduced. typecheck:tsc and bun test (178 pass) succeed in services/site.

From the code:

  • Banner: reading layout before the write, and starting from 0px to match the CSS fallback, works with the existing cleanup that removes --banner-scroll. A remount can't keep an old value, and a page restored partway down still writes on mount.
  • Console dots: deferring the dot effect is safe, because a ResizeObserver always calls back once for a newly observed element, so the first draw still happens.
  • Strobe tooling: the benches, perf/serve.ts, strobe.json and the STROBE_SOURCEMAP-gated sourcemap are dev-only and leave production builds unchanged.

Public API: unchanged.

@adamdotdevin
adamdotdevin merged commit f270347 into dev Nov 6, 2026
15 checks passed
@adamdotdevin
adamdotdevin deleted the site-strobe branch November 6, 2026 20:33
autonull pushed a commit to autonull/opencode_spacegraph that referenced this pull request Nov 7, 2026
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