Skip to content

Decode small Flate streams through asyncGetBytes (bug 2086217) - #22385

Merged
calixteman merged 1 commit into
mozilla:masterfrom
calixteman:perf/bug-2086217-flate-small-streams
Oct 29, 2026
Merged

calixteman merged 1 commit into
mozilla:masterfrom
calixteman:perf/bug-2086217-flate-small-streams

Conversation

@calixteman

Copy link
Copy Markdown
Contributor

Keep small Flate streams marked async and return their JS-decoded bytes so callers wrap them in plain Streams.

For small image streams, prefer native decoding when the expected output exceeds 16 KiB. Preserve repeated reads when requested lengths change.

@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Viewer preview

🗑️ Viewer previews removed.

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

codecov-commenter commented Oct 29, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.57%. Comparing base (d7fd526) to head (d7e358b).

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #22385   +/-   ##
=======================================
  Coverage   90.56%   90.57%           
=======================================
  Files         278      278           
  Lines       68562    68568    +6     
=======================================
+ Hits        62096    62106   +10     
+ Misses       6466     6462    -4     
Flag Coverage Δ
browsertest 66.29% <100.00%> (+0.02%) ⬆️
fonttest 8.99% <22.22%> (+<0.01%) ⬆️
unittest 61.25% <100.00%> (-0.02%) ⬇️
unittestcli 59.01% <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.

@codspeed

codspeed Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Merging this PR will regress 1 benchmark

⚡ 2 improved benchmarks
❌ 1 regressed benchmark
✅ 85 untouched benchmarks
⏩ 174 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
❌ PDFImage.createImageData: DeviceN, PostScript tint (colorspace_cos.pdf) 11.3 ms 12.9 ms -12.09%
⚡ PartialEvaluator.buildPath: lines (bug1743245.pdf) 19.4 ms 15 ms +29.54%
⚡ XFAFactory.getRichTextAsHtml (issue13447.pdf) 2.1 ms 1.9 ms +10.67%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing calixteman:perf/bug-2086217-flate-small-streams (d7e358b) with master (d7fd526)

Open in CodSpeed

Footnotes

  1. 174 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Reference tests

Results for d7e358b (run, references from mozilla/pdf.js.refs@4694e71d21).

Platform Status Tests Total runtime Errors Different FBF No reference Report
Linux ⚠️ 1413 12m 27s 0 1 0 0 view differences
Windows ✅ 1413 15m 27s 0 0 0 0

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 29, 2026

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

r=me, with a question; thanks.

Comment thread src/core/flate_stream.js Resolved
@calixteman
calixteman force-pushed the perf/bug-2086217-flate-small-streams branch 2 times, most recently from f6033af to 5a63317 Compare October 29, 2026 14:37
Keep small Flate streams marked async and return their JS-decoded bytes so
callers wrap them in plain Streams.

For small image streams, prefer native decoding when the expected output
exceeds 16 KiB. Preserve repeated reads when requested lengths change.
@calixteman
calixteman force-pushed the perf/bug-2086217-flate-small-streams branch from 5a63317 to d7e358b Compare October 29, 2026 14:38
sync-pdfs-for-pdf-js Bot pushed a commit to mozilla/pdf.js.refs that referenced this pull request Oct 29, 2026
sync-pdfs-for-pdf-js Bot pushed a commit to mozilla/pdf.js.refs that referenced this pull request Oct 29, 2026
@calixteman
calixteman merged commit 22f5df1 into mozilla:master Oct 29, 2026
27 of 28 checks passed
@calixteman
calixteman deleted the perf/bug-2086217-flate-small-streams branch October 29, 2026 15:48
sync-pdfs-for-pdf-js Bot pushed a commit to mozilla/pdf.js.refs that referenced this pull request Oct 29, 2026

This branch was successfully deployed

1 active deployment
sync_pdfs — d7e358bd Deployed Oct 29, 2026 by calixteman via request #669
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