Skip to content

improve: reduce Cron search and rendering work - #189124

Merged
steipete merged 1 commit into
mainfrom
solid2/w-webkit-cron-r2-1030
Oct 31, 2026
Merged

steipete merged 1 commit into
mainfrom
solid2/w-webkit-cron-r2-1030

Conversation

@steipete

@steipete steipete commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Large Cron lists spend substantial time constructing, focusing through, and removing decorative row markup, especially in WebKit.

Related: #189030, #189052.

User Impact

Cron search and row rendering do less work while keeping the existing controls, accessible names, keyboard focus, filtering, and menu placement. The WebKit/Chromium application-time target of ≤1.3× is not reached; the remaining measured gap is recorded below, not claimed as an irreducible floor.

Why This Change Was Made

Use the existing immutable mask renderer for the Run now and More glyphs. The 500-job fixture drops from 24,008 to 22,008 elements, without a new cache, state owner, dependency, or lazy import. Match the existing dimensions/stroke and use system ButtonText/GrayText in forced-color mode; the first visual diagnostic caught the mask background disappearing under forced colors.

Timeline/source-map inspection found native focus inside Menu's initial-focus callback dominates menu opening, native removal through Solid's keyed reconciler dominates filtering, and construction/insertion plus style recalculation dominates opening. Search retains the matching row; it does not rerender every retained row. Same-root menu positioning uses CSS anchors. The overlay-registry scan was small in these samples, so this PR does not rewrite its lifecycle or alter focus behavior.

Evidence

Acceptance recorded before measurement: production fixture, 500 jobs for search/menu and 50 for warm open; serial interleaved base/head/base A/A; both engines and viewports; native-input-to-last-DOM-commit application elapsed time. Ten pairs per search cell; twenty per open/menu cell after the first ten exposed noisy tails. No attributed >5% median regression or worse tail; >20% attributable regressions reject the change. Driver and settle are separate. WebKit CPUProfiler utilization is not used as CPU time.

Base: a4b07c63b60cf3a971c824064c82946c530e1686. Same host, fixed production bundles. Headless only, synthetic Gateway; no live provider latency. Host load and A/A are retained with every observation.

Action View Engine N Base ms med/p95 Head ms med/p95 Paired change A/A change
cron-menu-open desktop chromium 20 34.7/97.3 35.8/105.5 +5.6% -2.6%
cron-menu-open desktop webkit 20 111.0/116.2 106.0/114.8 -3.4% -0.4%
cron-menu-open mobile chromium 20 27.8/34.6 29.7/35.3 +4.5% +5.3%
cron-menu-open mobile webkit 20 75.0/86.5 70.5/82.2 -5.6% +2.6%
cron-open desktop chromium 20 47.6/49.8 44.3/47.5 -6.2% +0.1%
cron-open desktop webkit 20 100.5/108.0 101.0/110.2 -0.7% +0.5%
cron-open mobile chromium 20 48.2/65.1 30.7/63.5 -8.1% -0.6%
cron-open mobile webkit 20 106.0/114.1 103.0/107.4 -3.2% +1.0%
cron-search desktop chromium 10 26.7/42.1 24.4/39.1 -15.3% -2.1%
cron-search desktop webkit 10 65.5/79.7 60.5/73.0 -9.0% +0.8%
cron-search mobile chromium 10 28.0/29.1 26.5/27.8 -7.1% +1.8%
cron-search mobile webkit 10 76.5/82.8 72.0/76.5 -0.9% -1.3%
Observations: 600 failed: 0
Host 1m load min/median/max: 13.67431640625 21.98876953125 35.23388671875

Values are application milliseconds (median/p95). Paired change compares head against the geometric mean of its two adjacent base observations. All 600/600 observations passed. One-minute host load ranged 13.7–35.2, median 22.0.

The noisy exceptions are explicit: Chromium menu raw medians rise about 1.1 ms desktop / 1.9 ms mobile; desktop p95 rises 8.2 ms. The unchanged desktop A/A p95 shifts 97.3 → 39.2 ms, and mobile A/A median drifts +5.3%. Under the prescribed noisy-host rule, twenty-pair Chromium script/task CPU and structure decide: desktop script 12.97 → 13.15 ms (paired −0.7%), task 118.75 → 113.16 ms (paired −2.8%); mobile script 12.54 → 12.84 ms (paired +0.4%), task 100.91 → 98.00 ms (paired −1.4%). No script/task CPU regression. WebKit desktop open is effectively flat: median +0.5 ms and p95 +2.2 ms across twenty pairs; no speedup claimed there.

Remaining head W/C application ratios: menu desktop/mobile 2.96× / 2.38×; search 2.48× / 2.72×; open 2.28× / 3.36×. The mobile-open ratio rises because Chromium gets faster; WebKit absolute time falls. These are an attributed remaining gap, not a claim of a universal floor.

Rerunnable workload: node --import ./scripts/tsx.mjs scripts/bench-control-ui-engines.ts --bundle-dir <base-build> --compare-bundle-dir <head-build> --control-bundle-dir <base-build> --steps cron-menu-open,cron-search,cron-open --viewport both --engines chromium,webkit --pairs 10 --output <proof-dir>; the second ten pairs retain only open/menu. Separate source-mapped diagnostic runs use --trace.

Timeline attribution

Two baseline WebKit traces per action/view, source-mapped, clipped to native input → last DOM commit. This is diagnostic elapsed time with trace overhead, not the untraced performance comparison. The table partitions overlaps in priority order paint/layout/style/script; composite envelopes are excluded. Script includes native browser work invoked by script. Uncovered time is not relabelled as script.

View/action App ms Script/native Style Layout Paint Uncovered
desktop / cron-menu-open 123.5 91.5 14.6 1.5 1.5 14.4
desktop / cron-open 120.5 48.6 34.8 9.9 1.5 25.7
desktop / cron-search 126.5 79.8 0.2 0.0 26.9 19.6
mobile / cron-menu-open 116.5 67.2 7.2 2.4 0.8 38.8
mobile / cron-open 129.0 56.6 35.7 17.6 1.1 18.0
mobile / cron-search 107.5 87.8 4.0 0.1 6.7 8.9

Final-head trace ranges (two per cell, all 12 passed), using the same disjoint partition:

View/action App ms Script/native Style Layout Paint Uncovered
desktop / cron-menu-open 117.0–122.0 84.6–87.3 14.9–16.4 1.5–1.6 1.4–1.6 14.6–15.2
desktop / cron-open 108.0–112.0 39.2–40.4 31.5–32.4 8.9–9.6 1.5–1.5 26.9–28.1
desktop / cron-search 69.0–129.0 68.6–74.1 0.0–0.2 0.0–0.0 0.0–31.6 0.4–23.1
mobile / cron-menu-open 74.0–85.0 57.3–57.5 4.2–5.5 1.3–2.4 0.6–0.8 10.6–18.7
mobile / cron-open 122.0–124.0 49.3–53.0 35.7–35.7 16.0–16.2 1.1–1.1 18.2–19.7
mobile / cron-search 95.0–97.0 76.2–76.8 4.5–4.6 0.1–0.3 6.3–7.7 7.0–8.5

Paint may land after the last DOM mutation and therefore outside this application window. The 69–129 ms traced desktop-search spread illustrates why these diagnostic runs are not used to infer the speedup. Final source maps again identify Menu initial focus (45/109 full-profile leaf samples) and keyed native removal (40 samples); sample counts are qualitative only.

Many WebKit sample timestamps are zero, so sample counts only identify likely call paths. Search's large native select sample count belongs to Playwright's pre-input driver preparation and is excluded from application attribution. The remaining ratio gap needs a further measured improvement in native focus/removal/style work; these traces do not establish that it is unavoidable.

Check Result
UI typecheck pnpm tsgo:ui passed
Focused tests Cron description/reactivity, 12/12 passed
Static checks Scoped oxlint, stylelint, format, diff check passed
Production Knip pnpm deadcode:knip passed; no new ignores
Production build + strict performance Base and head passed
Startup JS 88,763 → 88,791 B gzip (+28 B, within 64 B build variance); 3 requests
Startup CSS 33,568 → 33,568 B gzip; 1 request
Visual/accessibility diagnostic Inspected synthetic desktop/mobile before/after; forced-color diagnostic passed
Independent review Complete three-file diff, scoped-clean through P2

Production LOC across the three touched files: 1,797 → 1,808 (+15/−4). The growth is the required system-color CSS. No test LOC added. Solid refactor census: effects, render effects, untrack, listeners, DOM queries, flush, owner APIs, cleanup, controllers and manual loaders all remain 0 → 0 in the touched TSX files. The simplification reuses the existing glyph renderer; it introduces no abstraction.

Screenshots

Inspected synthetic WebKit menu captures, before/after at desktop and mobile. They preserve the existing appearance and geometry.

Desktop before Desktop after
Desktop Cron before Desktop Cron after
Mobile before Mobile after
Mobile Cron before Mobile Cron after

@clawsweeper

clawsweeper Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-31T06:18:31.095611Z 0b58fbb PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@steipete
steipete enabled auto-merge (squash) October 31, 2026 06:23
@steipete
steipete merged commit b8a04d5 into main Oct 31, 2026
95 of 100 checks passed
@steipete
steipete deleted the solid2/w-webkit-cron-r2-1030 branch October 31, 2026 06:25
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash auto-merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant