Skip to content

[Deploy] Comparison reports#6012

Draft
mstange wants to merge 9 commits into
firefox-devtools:mainfrom
mstange:comparison-reports
Draft

[Deploy] Comparison reports#6012
mstange wants to merge 9 commits into
firefox-devtools:mainfrom
mstange:comparison-reports

Conversation

@mstange

@mstange mstange commented May 8, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@mstange mstange force-pushed the comparison-reports branch 2 times, most recently from a3cc414 to 4bd0212 Compare May 12, 2026 18:02
@mstange mstange force-pushed the comparison-reports branch from b345b45 to 0c8885a Compare June 4, 2026 21:22
mstange and others added 9 commits July 3, 2026 16:13
The tooltip uses `position: fixed` which interprets `left/top` as viewport-relative,
but `ChartCanvas` was storing `event.pageX/pageY` (document-relative, including 
scroll offsets). In a non-scrolling page these match, but inside a scrollable 
container like our benchmark page they diverge by `window.scrollY`, dragging the 
tooltip down.

Switched the state field from `pageX/pageY` to `clientX/clientY`.
This is a workaround for Firefox and Chrome using different syntax
to indicate the location of a JS function.

On Windows, the difference is samply's fault: The JIT ETW events
already allow specifying the URL and line/col separately from the
function name, but samply puts it back into the function name.

And Firefox doesn't make use of those ETW events yet.
The tie-correction counts can be built directly from the two input arrays,
so mannWhitneyPValue no longer needs the pre-concatenated allValues array.
Every caller was passing baseIter/newIter and separately concatenating them
into allValues just for this function.
The extractor previously produced a per-bucket number[] copy of the dense
bucketIterationTotals buffer, at ~200k small allocations per profile. Widen
SparseBucketEntry.iterationTotals to Float64Array | number[] and hand out
subarray() views instead. The downstream consumers (mean, mannWhitneyU,
mannWhitneyPValue) are widened to ArrayLike<number> and use indexed loops,
and buildKeyMap now borrows entries on first insert, only materialising a
fresh Float64Array on the rare key-collision case.

The CLI serialiser converts Float64Array to plain arrays via a JSON.stringify
replacer, since typed arrays stringify as {"0": ...} otherwise.
Replace the naive O(n1 * n2) nested loop with an O((n1 + n2) log(n1 + n2))
algorithm: sort a and b once each, then walk them in a single pass with
two monotonic pointers into the sorted b that count b[j] < ai and b[j] <= ai
respectively. At n=200 (Speedometer iterations) and ~200k MWU calls per
profile pair, this drops the compare-benchmark load-time contribution of
mannWhitneyU from ~30% to ~3%.
Before: https://share.firefox.dev/4azGzbu (230ms concatenation)
After: https://share.firefox.dev/4vNj739 (60ms concatenation, 3.8x faster)
@mstange mstange force-pushed the comparison-reports branch from 0c8885a to 8600e06 Compare July 7, 2026 21:30
@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 1.89036% with 1038 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.20%. Comparing base (c765a85) to head (8600e06).
⚠️ Report is 20 commits behind head on main.

Files with missing lines Patch % Lines
src/profile-logic/benchmark/benchmark-stuff.ts 0.00% 275 Missing ⚠️
src/profile-logic/benchmark/perf-compare-stats.ts 0.38% 259 Missing ⚠️
src/components/app/BenchmarkCompareViewer.tsx 1.11% 177 Missing ⚠️
...profile-logic/benchmark/extract-benchmark-stats.ts 0.00% 97 Missing ⚠️
...profile-logic/benchmark/compare-benchmark-stats.ts 0.00% 83 Missing ⚠️
...profile-logic/benchmark/bucket-flame-graph-data.ts 0.00% 61 Missing ⚠️
src/node-tools/profiler-edit.ts 2.32% 42 Missing ⚠️
src/components/app/BucketFlameGraphPair.tsx 0.00% 21 Missing ⚠️
src/app-logic/url-handling.ts 33.33% 6 Missing ⚠️
src/components/app/AppViewRouter.tsx 0.00% 4 Missing ⚠️
... and 6 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6012      +/-   ##
==========================================
- Coverage   83.46%   81.20%   -2.26%     
==========================================
  Files         342      349       +7     
  Lines       36346    37571    +1225     
  Branches    10208    10399     +191     
==========================================
+ Hits        30335    30511     +176     
- Misses       5583     6632    +1049     
  Partials      428      428              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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