Closed Bug 1966721 Opened 1 year ago Closed 21 days ago

Improve PDF.js startup perf by starting the worker as soon as possible

Categories

(Firefox :: PDF Viewer, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
156 Branch
Tracking Status
relnote-firefox --- 156+
firefox156 --- fixed

People

(Reporter: calixte, Assigned: calixte)

References

Details

(Keywords: perf, perf-alert, Whiteboard: [pdfjs-performance])

Attachments

(2 files)

The worker takes some time to load its module so we've to wait a bit for it.

Type: task → enhancement
Keywords: perf
Whiteboard: [pdfjs-performance]
Blocks: 1966766
No longer blocks: 1966766
Depends on: 1966766
Attachment #9488087 - Attachment description: Bug 1966721 - Initialize the pdf.js worker immediately after the child actor is created to reduce the startup delay r=#pdfjs-reviewers → Bug 1966721 - Initialize the pdf.js worker just before the actor is created to reduce the startup delay r=#pdfjs-reviewers
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 141 Branch

For now I didn't land the m-c patch because the added test is failing in verify mode, so I've to fix it first.

Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Target Milestone: 141 Branch → ---

There is an r+ patch which didn't land and no activity in this bug for 2 weeks.
:calixte, could you have a look please?
If you still have some work to do, you can add an action "Plan Changes" in Phabricator.
For more information, please visit BugBot documentation.

Flags: needinfo?(rob)
Flags: needinfo?(cdenizet)

The test I added is failing in the CI in verify mode, so I need to rewrite it a bit.

Flags: needinfo?(rob)
Flags: needinfo?(cdenizet)
Pushed by cdenizet@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/3e8ee7b6ceb9 https://hg.mozilla.org/integration/autoland/rev/01e214d47ab4 Initialize the pdf.js worker just before the actor is created to reduce the startup delay r=pdfjs-reviewers,robwu
Regressions: 2066012
Pushed by ctuns@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/9d51f1ff2b80 https://hg.mozilla.org/integration/autoland/rev/82078fae3281 Revert "Bug 1966721 - Initialize the pdf.js worker just before the actor is created to reduce the startup delay r=pdfjs-reviewers,robwu" for causing bc failures in browser_pdfjs_preloaded_worker.js

Backed out for causing bc failures

  • Backout link
  • Push with failures
  • Failure Log
  • Failure line: TEST-UNEXPECTED-FAIL | toolkit/components/pdfjs/test/browser_pdfjs_preloaded_worker.js | test_no_worker_for_non_pdf_document - Uncaught exception in test - NotFoundError: WindowGlobalChild.getActor: No such JSWindowActor 'Pdfjs'
Flags: needinfo?(cdenizet)
Pushed by cdenizet@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/be3b7c354a7f https://hg.mozilla.org/integration/autoland/rev/156968f950e9 Initialize the pdf.js worker just before the actor is created to reduce the startup delay r=pdfjs-reviewers,robwu
Status: REOPENED → RESOLVED
Closed: 1 year ago21 days ago
Resolution: --- → FIXED
Target Milestone: --- → 156 Branch
Flags: needinfo?(cdenizet)

Perfherder has detected a talos performance change from push 01e214d47ab4adbe21dcddcb2be9e26d38cb72bd.

No action is required from the author; this comment is provided for informational purposes only.

Improvements Test Platform Options Absolute values [old vs new]
45% pdfpaint issue12295.pdf (doc) linux2404-64-shippable e10s fission stylo webrender 2,249.15 ms -> 1,233.60 ms
42% pdfpaint issue12295.pdf (doc) linux2404-64-shippable e10s fission stylo webrender-sw 1,835.11 ms -> 1,056.74 ms
35% pdfpaint issue14462_reduced.pdf (doc) macosx1470-64-shippable e10s fission stylo webrender 277.54 ms -> 181.32 ms
31% pdfpaint issue17981.pdf (doc) linux2404-64-shippable e10s fission stylo webrender 1,480.13 ms -> 1,027.26 ms
30% pdfpaint issue14497.pdf (doc) macosx1470-64-shippable e10s fission stylo webrender 274.10 ms -> 191.01 ms
... ... ... ... ...
6% pdfpaint issue9552.pdf (doc) windows11-64-24h2-shippable e10s fission stylo webrender-sw 259.46 ms -> 243.89 ms

Need Help or Information?

If you have any questions, please reach out to fbilt@mozilla.com. Alternatively, you can find help on Slack by joining #perf-help, and on Matrix you can find help by joining #perftest.

Details of the alert can be found in the alert summary, including links to graphs and comparisons for each of the affected tests.

Keywords: perf-alert

Perfherder has detected a talos performance change from push 01e214d47ab4adbe21dcddcb2be9e26d38cb72bd.

No action is required from the author; this comment is provided for informational purposes only.

Improvements Test Platform Options Absolute values [old vs new]
45% pdfpaint issue12295.pdf (doc) linux2404-64-shippable e10s fission stylo webrender 2,249.15 ms -> 1,233.60 ms
42% pdfpaint issue12295.pdf (doc) linux2404-64-shippable e10s fission stylo webrender-sw 1,835.11 ms -> 1,056.74 ms
35% pdfpaint issue14462_reduced.pdf (doc) macosx1470-64-shippable e10s fission stylo webrender 277.54 ms -> 181.32 ms
31% pdfpaint issue17981.pdf (doc) linux2404-64-shippable e10s fission stylo webrender 1,480.13 ms -> 1,027.26 ms
30% pdfpaint issue14497.pdf (doc) macosx1470-64-shippable e10s fission stylo webrender 274.10 ms -> 191.01 ms
... ... ... ... ...
6% pdfpaint issue9552.pdf (doc) windows11-64-24h2-shippable e10s fission stylo webrender-sw 259.46 ms -> 243.89 ms

Need Help or Information?

If you have any questions, please reach out to fbilt@mozilla.com. Alternatively, you can find help on Slack by joining #perf-help, and on Matrix you can find help by joining #perftest.

Details of the alert can be found in the alert summary, including links to graphs and comparisons for each of the affected tests.

Release Note Request (optional, but appreciated)
[Why is this notable]: felt user improvement
[Affects Firefox for Android]: dunno ?
[Suggested wording]: Firefox's built-in PDF viewer now starts up to 45% faster.
[Links (documentation, blog post, etc)]:

relnote-firefox: --- → ?
Summary: Start the worker as soon as possible → Improve PDF.js startup perf by starting the worker as soon as possible
QA Whiteboard: [qa-triage-done-c157/b156]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: