Skip to content

Fix sorting of tied iteration timings. - #338

Open
jirkamarsik wants to merge 1 commit into
WebKit:mainfrom
jirkamarsik:codex/jetstream3-comparator
Open

jirkamarsik wants to merge 1 commit into
WebKit:mainfrom
jirkamarsik:codex/jetstream3-comparator

Conversation

@jirkamarsik

Copy link
Copy Markdown

The descending timing comparator returns -1 for equal values, violating the comparator contract. On GraalJS, this can leave timings out of order and underestimate the Worst phase.

Use numeric descending comparison so ties compare as zero. Add a regression with many samples at the 1 ms floor: the old comparator reports a Worst time of 1.25 ms on GraalJS instead of the correct 4 ms. The test also checks that First and Average are unchanged.

The regression fails before the fix and passes afterward on native GraalJS. The full tests/unit-tests.js suite passes on V8 15.8.62.91.

Suggested review order: the comparator in DefaultBenchmark.processResults, then the regression in tests/unit-tests.js.

Return zero when iteration times are equal. An inconsistent comparator can leave results out of order and underestimate the Worst phase on GraalJS.
@netlify

netlify Bot commented Dec 4, 2026

Copy link
Copy Markdown

👷 Deploy request for webkit-jetstream-preview pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 063abfd

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