Skip to content

Avoid five-argument Math.min/max calls in Util.axialAlignedBoundingBox - #22290

Merged
calixteman merged 2 commits into
mozilla:masterfrom
calixteman:util_minmax_arity
Oct 21, 2026
Merged

calixteman merged 2 commits into
mozilla:masterfrom
calixteman:util_minmax_arity

Conversation

@calixteman

Copy link
Copy Markdown
Contributor

Math.min/Math.max with more than 4 arguments aren't optimized by SpiderMonkey (see tryAttachMathMinMax in CacheIR.cpp); this makes Util.axialAlignedBoundingBox ~3.4x faster in Firefox, no change in V8.

Math.min/Math.max with more than 4 arguments aren't optimized by
SpiderMonkey (see tryAttachMathMinMax in CacheIR.cpp); this makes
Util.axialAlignedBoundingBox ~3.4x faster in Firefox, no change in V8.
@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Reference tests

Results for 552de2c (run, references from mozilla/pdf.js.refs@6cc7acf45c).

Platform Status Tests Total runtime Errors Different FBF No reference Report
Linux ✅ 1405 10m 41s 0 0 0 0
Windows ⚠️ 1405 15m 2s 0 1 0 0 view differences

The report is kept for 30 days and replaced by the next run.

sync-pdfs-for-pdf-js Bot pushed a commit to mozilla/pdf.js.refs that referenced this pull request Oct 21, 2026
@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Viewer preview

🗑️ Viewer previews removed.

@codecov-commenter

codecov-commenter commented Oct 21, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.46%. Comparing base (d2f4327) to head (a79d4fe).

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #22290      +/-   ##
==========================================
- Coverage   90.46%   90.46%   -0.01%     
==========================================
  Files         277      277              
  Lines       68274    68274              
==========================================
- Hits        61766    61764       -2     
- Misses       6508     6510       +2     
Flag Coverage Δ
browsertest 66.32% <100.00%> (+0.01%) ⬆️
fonttest 8.98% <0.00%> (ø)
integrationtest 69.46% <100.00%> (ø)
unittest 60.85% <100.00%> (-0.02%) ⬇️
unittestcli 58.61% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

sync-pdfs-for-pdf-js Bot pushed a commit to mozilla/pdf.js.refs that referenced this pull request Oct 21, 2026
@codspeed

codspeed Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 86 untouched benchmarks


Comparing calixteman:util_minmax_arity (a79d4fe) with master (d2f4327)

Open in CodSpeed

@Snuffleupagus Snuffleupagus left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Have you checked that there are no other spots in the code-base that would benefit from the same change?

Would it make sense to add a custom ESLint rule to enforce this pattern?

r=me, thanks.

sync-pdfs-for-pdf-js Bot pushed a commit to mozilla/pdf.js.refs that referenced this pull request Oct 21, 2026
@calixteman

Copy link
Copy Markdown
Contributor Author

Have you checked that there are no other spots in the code-base that would benefit from the same change?

I haven't but I checked and I didn't find anything.

Would it make sense to add a custom ESLint rule to enforce this pattern?

Done in a second commit.

r=me, thanks.

@calixteman
calixteman merged commit d213faf into mozilla:master Oct 21, 2026
23 checks passed
@calixteman
calixteman deleted the util_minmax_arity branch October 21, 2026 20:19
sync-pdfs-for-pdf-js Bot pushed a commit to mozilla/pdf.js.refs that referenced this pull request Oct 21, 2026
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.

3 participants