Skip to content

Update getTextContent to use getReader instead - #22329

Merged
Snuffleupagus merged 1 commit into
mozilla:masterfrom
Snuffleupagus:getTextContent-getReader
Oct 24, 2026
Merged

Snuffleupagus merged 1 commit into
mozilla:masterfrom
Snuffleupagus:getTextContent-getReader

Conversation

@Snuffleupagus

Copy link
Copy Markdown
Collaborator

Given that PR 22276 just replaced a for await loop, since a while loop over getReader invocations is apparently faster, let's do the same thing in the getTextContent method.

Given that PR 22276 just replaced a `for await` loop, since a `while` loop over `getReader` invocations is apparently faster, let's do the same thing in the `getTextContent` method.
@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Reference tests

Results for f913cc0 (run, references from mozilla/pdf.js.refs@b5c54fdd60).

Platform Status Tests Total runtime Errors Different FBF No reference Report
Linux ✅ 1407 11m 23s 0 0 0 0
Windows ✅ 1407 15m 34s 0 0 0 0

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

@codecov-commenter

codecov-commenter commented Oct 24, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.42%. Comparing base (4c99803) to head (f913cc0).

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #22329      +/-   ##
==========================================
- Coverage   90.50%   90.42%   -0.09%     
==========================================
  Files         277      277              
  Lines       68401    68405       +4     
==========================================
- Hits        61908    61852      -56     
- Misses       6493     6553      +60     
Flag Coverage Δ
browsertest 66.30% <100.00%> (+<0.01%) ⬆️
fonttest 8.98% <ø> (ø)
integrationtest 69.33% <100.00%> (-0.14%) ⬇️
unittest 60.94% <100.00%> (+<0.01%) ⬆️
unittestcli 58.67% <100.00%> (-0.01%) ⬇️

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 24, 2026
@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Viewer preview

🗑️ Viewer previews removed.

@codspeed

codspeed Bot commented Oct 24, 2026

Copy link
Copy Markdown

Merging this PR will regress 2 benchmarks

⚡ 6 improved benchmarks
❌ 2 regressed benchmarks
✅ 80 untouched benchmarks
⏩ 86 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
❌ PDFImage.createImageData: Indexed 4 bpc (issue7200.pdf) 16.3 ms 22.5 ms -27.5%
❌ PredictorStream: PNG xref streams (issue20513.pdf) 402.3 µs 443 µs -9.19%
⚡ Autolinker.processLinks: 2 links in each of 5000 text items 91.2 ms 82.8 ms +10.09%
⚡ EvaluatorPreprocessor.read: paths (bug1743245.pdf) 58.3 ms 53.5 ms +9.02%
⚡ Autolinker.processLinks: 10 links in each of 1000 text items 72.2 ms 66.9 ms +7.96%
⚡ OperatorList.addOp: image masks (bug1799927.pdf) 1.9 ms 1.8 ms +6.95%
⚡ Lexer.getObj: paths (bug1743245.pdf) 25 ms 23.5 ms +6.61%
⚡ Lexer.getObj: text (issue12963.pdf) 18.9 ms 18 ms +5.07%

Tip

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


Comparing Snuffleupagus:getTextContent-getReader (f913cc0) with master (c889a73)2

Open in CodSpeed

Footnotes

  1. 86 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. ↩

  2. No successful run was found on master (4c99803) during the generation of this report, so c889a73 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

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

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

Looks good to me, with passing CI. Thanks!

@Snuffleupagus
Snuffleupagus merged commit 7b9d753 into mozilla:master Oct 24, 2026
31 of 32 checks passed
@Snuffleupagus
Snuffleupagus deleted the getTextContent-getReader branch October 24, 2026 18:53
sync-pdfs-for-pdf-js Bot pushed a commit to mozilla/pdf.js.refs that referenced this pull request Oct 24, 2026

This branch was previously deployed

1 inactive deployment
sync_pdfs — f913cc01 Deployed Oct 24, 2026 by Snuffleupagus via request #603
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