Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[api-minor] Only use Workers when postMessage transfers are supported (PR 11123 follow-up) #14291

Merged

Conversation

Snuffleupagus
Copy link
Collaborator

Given that all modern browsers now support postMessage transfers, and have for years, it no longer seems necessary for the PDF.js library to support using Workers unless the postMessage transfers functionality is available.
This patch is a follow-up to PR #11123, which made it impossible to manually disable postMessage transfers for performance reasons (since it increases memory usage), which hasn't caused any bug reports as far as I know.[1]

Hence we'll now only support proper Worker implementations, with fully working postMessage transfers, and fallback to using "fake" Workers otherwise.


[1] At the time of that PR we still "supported" IE, which is why this code was left intact.

…ed (PR 11123 follow-up)

Given that all modern browsers now support `postMessage` transfers, and have for years, it no longer seems necessary for the PDF.js library to support using Workers unless the `postMessage` transfers functionality is available.
This patch is a follow-up to PR 11123, which made it impossible to *manually* disable `postMessage` transfers for performance reasons (since it increases memory usage), which hasn't caused any bug reports as far as I know.[1]

Hence we'll now only support *proper* Worker implementations, with fully working `postMessage` transfers, and fallback to using "fake" Workers otherwise.

---
[1] At the time of that PR we still "supported" IE, which is why this code was left intact.
@Snuffleupagus
Copy link
Collaborator Author

/botio test

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_test from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.241.84.105:8877/9921149ebc696dd/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_test from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.193.163.58:8877/e3ce12f6202d3d8/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/9921149ebc696dd/output.txt

Total script time: 22.20 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Integration Tests: FAILED
  • Regression tests: FAILED
  different ref/snapshot: 11
  different first/second rendering: 2

Image differences available at: http://54.241.84.105:8877/9921149ebc696dd/reftest-analyzer.html#web=eq.log

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/e3ce12f6202d3d8/output.txt

Total script time: 42.29 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Integration Tests: Passed
  • Regression tests: FAILED
  different ref/snapshot: 9
  different first/second rendering: 1

Image differences available at: http://54.193.163.58:8877/e3ce12f6202d3d8/reftest-analyzer.html#web=eq.log

@Snuffleupagus
Copy link
Collaborator Author

Snuffleupagus commented Nov 19, 2021

I'm pretty much certain that the integration-test failures aren't related to this patch, given that I'm not touching any test-related code in this patch, that they only fail on Linux, and finally that other recent PRs have shown identical errors.

@calixteman
Copy link
Contributor

Oh... these errors look strange.
It seems that something is wrong with Firefox.
Anyway I agree: your patch is very likely not responsible of these issues.

@timvandermeij
Copy link
Contributor

Indeed, I have confirmed in #14233 (comment) that it also happened here, so it's not specific to this patch. Fortunately this is already tracked in #14293.

@timvandermeij timvandermeij merged commit 41ac3f0 into mozilla:master Nov 19, 2021
@timvandermeij
Copy link
Contributor

Nice clean-up!

@Snuffleupagus Snuffleupagus deleted the force-postMessageTransfers branch November 19, 2021 20:25
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.

4 participants