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

Inline the resolveCall helper function at its call-sites in MessageHandler #11111

Merged

Conversation

Snuffleupagus
Copy link
Collaborator

@Snuffleupagus Snuffleupagus commented Sep 1, 2019

There's only three call-sites and one of them doesn't even need the complete functionality of resolveCall, hence it seems reasonable to just inline this code.
An additional benefit of this is that the Function.prototype.apply() instance can also be converted into "normal" function calls, which should be a tiny bit more efficient.

The patch also replaces a number of unnecessary arrow functions, in relevant parts of the MessageHandler code, with "normal" functions instead.
Finally, all Promise.resolve().then(...) calls are replaced with new Promise(...) instead since the latter is a tiny bit more efficient. This also explains the test failures on the Linux bot, with a prior version of the patch, since the Promise.resolve().then(...) format essentially creates two Promises thus causing additional delay.

@Snuffleupagus Snuffleupagus changed the title Message handler resolve call [WIP] MessageHandler-resolveCall Sep 1, 2019
@pdfjsbot
Copy link

pdfjsbot commented Sep 1, 2019

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/4dce5e99f4179d9/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Sep 1, 2019

From: Bot.io (Windows)


Received

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

Live output at: http://54.215.176.217:8877/56185bcf00b0715/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Sep 1, 2019

From: Bot.io (Linux m4)


Failed

Full output at http://54.67.70.0:8877/4dce5e99f4179d9/output.txt

Total script time: 2.58 mins

  • Unit Tests: FAILED

@pdfjsbot
Copy link

pdfjsbot commented Sep 1, 2019

From: Bot.io (Windows)


Success

Full output at http://54.215.176.217:8877/56185bcf00b0715/output.txt

Total script time: 4.96 mins

  • Unit Tests: Passed

@pdfjsbot
Copy link

pdfjsbot commented Sep 1, 2019

From: Bot.io (Windows)


Received

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

Live output at: http://54.215.176.217:8877/f8da6d6b1ad6450/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Sep 1, 2019

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/69f0233782e8acc/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Sep 1, 2019

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/69f0233782e8acc/output.txt

Total script time: 2.58 mins

  • Unit Tests: Passed

@pdfjsbot
Copy link

pdfjsbot commented Sep 1, 2019

From: Bot.io (Windows)


Success

Full output at http://54.215.176.217:8877/f8da6d6b1ad6450/output.txt

Total script time: 5.08 mins

  • Unit Tests: Passed

@pdfjsbot
Copy link

pdfjsbot commented Sep 1, 2019

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/e541c56d3363d0b/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Sep 1, 2019

From: Bot.io (Linux m4)


Failed

Full output at http://54.67.70.0:8877/e541c56d3363d0b/output.txt

Total script time: 2.62 mins

  • Unit Tests: FAILED

@pdfjsbot
Copy link

pdfjsbot commented Sep 1, 2019

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/86df6eceb2165a7/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Sep 1, 2019

From: Bot.io (Linux m4)


Failed

Full output at http://54.67.70.0:8877/86df6eceb2165a7/output.txt

Total script time: 2.59 mins

  • Unit Tests: FAILED

@pdfjsbot
Copy link

pdfjsbot commented Sep 1, 2019

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/7676f8f707be6af/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Sep 1, 2019

From: Bot.io (Linux m4)


Failed

Full output at http://54.67.70.0:8877/7676f8f707be6af/output.txt

Total script time: 2.58 mins

  • Unit Tests: FAILED

@pdfjsbot
Copy link

pdfjsbot commented Sep 1, 2019

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/01743c8efecc8aa/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Sep 1, 2019

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/01743c8efecc8aa/output.txt

Total script time: 2.59 mins

  • Unit Tests: Passed

@pdfjsbot
Copy link

pdfjsbot commented Sep 1, 2019

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/208409eee2472cc/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Sep 1, 2019

From: Bot.io (Windows)


Received

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

Live output at: http://54.215.176.217:8877/b4ed8f18b3188b2/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Sep 1, 2019

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/208409eee2472cc/output.txt

Total script time: 2.56 mins

  • Unit Tests: Passed

@pdfjsbot
Copy link

pdfjsbot commented Sep 1, 2019

From: Bot.io (Windows)


Success

Full output at http://54.215.176.217:8877/b4ed8f18b3188b2/output.txt

Total script time: 4.98 mins

  • Unit Tests: Passed

@pdfjsbot
Copy link

pdfjsbot commented Sep 1, 2019

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/590ce06e210086e/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Sep 1, 2019

From: Bot.io (Windows)


Received

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

Live output at: http://54.215.176.217:8877/f07f23b36721d44/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Sep 1, 2019

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/590ce06e210086e/output.txt

Total script time: 2.57 mins

  • Unit Tests: Passed

@pdfjsbot
Copy link

pdfjsbot commented Sep 1, 2019

From: Bot.io (Windows)


Success

Full output at http://54.215.176.217:8877/f07f23b36721d44/output.txt

Total script time: 4.98 mins

  • Unit Tests: Passed

@Snuffleupagus Snuffleupagus changed the title [WIP] MessageHandler-resolveCall Inline the resolveCall helper function at its call-sites in MessageHandler Sep 1, 2019
…eHandler`

There's only three call-sites and one of them doesn't even need the complete functionality of `resolveCall`, hence it seems reasonable to just inline this code.
An additional benefit of this is that the `Function.prototype.apply()` instance can also be converted into "normal" function calls, which should be a tiny bit more efficient.

The patch also replaces a number of unnecessary arrow functions, in relevant parts of the `MessageHandler` code, with "normal" functions instead.
Finally, all `Promise.resolve().then(...)` calls are replaced with `new Promise(...)` instead since the latter is a tiny bit more efficient. This also explains the test failures on the Linux bot, with a prior version of the patch, since the `Promise.resolve().then(...)` format essentially creates two Promises thus causing additional delay.
@pdfjsbot
Copy link

pdfjsbot commented Sep 1, 2019

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/c36731893271bf7/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Sep 1, 2019

From: Bot.io (Windows)


Received

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

Live output at: http://54.215.176.217:8877/4aea7dea7c7ac1d/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Sep 1, 2019

From: Bot.io (Linux m4)


Failed

Full output at http://54.67.70.0:8877/c36731893271bf7/output.txt

Total script time: 2.59 mins

  • Unit Tests: FAILED

@pdfjsbot
Copy link

pdfjsbot commented Sep 1, 2019

From: Bot.io (Windows)


Success

Full output at http://54.215.176.217:8877/4aea7dea7c7ac1d/output.txt

Total script time: 5.00 mins

  • Unit Tests: Passed

@pdfjsbot
Copy link

pdfjsbot commented Sep 1, 2019

From: Bot.io (Windows)


Received

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

Live output at: http://54.215.176.217:8877/767d12fb482a3a1/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Sep 1, 2019

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/21ca2a80a7bbd2e/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Sep 1, 2019

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/21ca2a80a7bbd2e/output.txt

Total script time: 2.59 mins

  • Unit Tests: Passed

@pdfjsbot
Copy link

pdfjsbot commented Sep 1, 2019

From: Bot.io (Windows)


Success

Full output at http://54.215.176.217:8877/767d12fb482a3a1/output.txt

Total script time: 4.90 mins

  • Unit Tests: Passed

@Snuffleupagus
Copy link
Collaborator Author

/botio test

@pdfjsbot
Copy link

pdfjsbot commented Sep 1, 2019

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/eb9a4d1d21c2598/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Sep 1, 2019

From: Bot.io (Windows)


Received

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

Live output at: http://54.215.176.217:8877/d6cab4ff7155aaf/output.txt

@Snuffleupagus Snuffleupagus marked this pull request as ready for review September 1, 2019 12:10
@pdfjsbot
Copy link

pdfjsbot commented Sep 1, 2019

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/eb9a4d1d21c2598/output.txt

Total script time: 17.58 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: Passed

@pdfjsbot
Copy link

pdfjsbot commented Sep 1, 2019

From: Bot.io (Windows)


Success

Full output at http://54.215.176.217:8877/d6cab4ff7155aaf/output.txt

Total script time: 26.03 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: Passed

@Snuffleupagus
Copy link
Collaborator Author

/botio unittest

@pdfjsbot
Copy link

pdfjsbot commented Sep 1, 2019

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/540da94476cb9dd/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Sep 1, 2019

From: Bot.io (Windows)


Received

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

Live output at: http://54.215.176.217:8877/e1dcdbbdd14731d/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Sep 1, 2019

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/540da94476cb9dd/output.txt

Total script time: 2.59 mins

  • Unit Tests: Passed

@pdfjsbot
Copy link

pdfjsbot commented Sep 1, 2019

From: Bot.io (Windows)


Success

Full output at http://54.215.176.217:8877/e1dcdbbdd14731d/output.txt

Total script time: 5.26 mins

  • Unit Tests: Passed

@timvandermeij timvandermeij merged commit 71477dc into mozilla:master Sep 2, 2019
@timvandermeij
Copy link
Contributor

Indeed, no need for that to be a helper function. Thanks!

@Snuffleupagus Snuffleupagus deleted the MessageHandler-resolveCall branch September 2, 2019 21:30
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