-
Notifications
You must be signed in to change notification settings - Fork 9.9k
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
Inline the resolveCall
helper function at its call-sites in MessageHandler
#11111
Conversation
From: Bot.io (Linux m4)ReceivedCommand cmd_unittest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/4dce5e99f4179d9/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_unittest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.215.176.217:8877/56185bcf00b0715/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.67.70.0:8877/4dce5e99f4179d9/output.txt Total script time: 2.58 mins
|
From: Bot.io (Windows)SuccessFull output at http://54.215.176.217:8877/56185bcf00b0715/output.txt Total script time: 4.96 mins
|
From: Bot.io (Windows)ReceivedCommand cmd_unittest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.215.176.217:8877/f8da6d6b1ad6450/output.txt |
From: Bot.io (Linux m4)ReceivedCommand cmd_unittest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/69f0233782e8acc/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/69f0233782e8acc/output.txt Total script time: 2.58 mins
|
b6c2026
to
31c889f
Compare
From: Bot.io (Windows)SuccessFull output at http://54.215.176.217:8877/f8da6d6b1ad6450/output.txt Total script time: 5.08 mins
|
From: Bot.io (Linux m4)ReceivedCommand cmd_unittest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/e541c56d3363d0b/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.67.70.0:8877/e541c56d3363d0b/output.txt Total script time: 2.62 mins
|
31c889f
to
e097826
Compare
From: Bot.io (Linux m4)ReceivedCommand cmd_unittest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/86df6eceb2165a7/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.67.70.0:8877/86df6eceb2165a7/output.txt Total script time: 2.59 mins
|
e097826
to
5864cf9
Compare
From: Bot.io (Linux m4)ReceivedCommand cmd_unittest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/7676f8f707be6af/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.67.70.0:8877/7676f8f707be6af/output.txt Total script time: 2.58 mins
|
From: Bot.io (Linux m4)ReceivedCommand cmd_unittest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/01743c8efecc8aa/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/01743c8efecc8aa/output.txt Total script time: 2.59 mins
|
From: Bot.io (Linux m4)ReceivedCommand cmd_unittest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/208409eee2472cc/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_unittest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.215.176.217:8877/b4ed8f18b3188b2/output.txt |
5864cf9
to
7c18b51
Compare
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/208409eee2472cc/output.txt Total script time: 2.56 mins
|
From: Bot.io (Windows)SuccessFull output at http://54.215.176.217:8877/b4ed8f18b3188b2/output.txt Total script time: 4.98 mins
|
From: Bot.io (Linux m4)ReceivedCommand cmd_unittest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/590ce06e210086e/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_unittest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.215.176.217:8877/f07f23b36721d44/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/590ce06e210086e/output.txt Total script time: 2.57 mins
|
From: Bot.io (Windows)SuccessFull output at http://54.215.176.217:8877/f07f23b36721d44/output.txt Total script time: 4.98 mins
|
7c18b51
to
c93ce64
Compare
resolveCall
helper function at its call-sites in MessageHandler
c93ce64
to
76a1d6c
Compare
…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.
76a1d6c
to
cd82b81
Compare
From: Bot.io (Linux m4)ReceivedCommand cmd_unittest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/c36731893271bf7/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_unittest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.215.176.217:8877/4aea7dea7c7ac1d/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.67.70.0:8877/c36731893271bf7/output.txt Total script time: 2.59 mins
|
From: Bot.io (Windows)SuccessFull output at http://54.215.176.217:8877/4aea7dea7c7ac1d/output.txt Total script time: 5.00 mins
|
From: Bot.io (Windows)ReceivedCommand cmd_unittest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.215.176.217:8877/767d12fb482a3a1/output.txt |
From: Bot.io (Linux m4)ReceivedCommand cmd_unittest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/21ca2a80a7bbd2e/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/21ca2a80a7bbd2e/output.txt Total script time: 2.59 mins
|
From: Bot.io (Windows)SuccessFull output at http://54.215.176.217:8877/767d12fb482a3a1/output.txt Total script time: 4.90 mins
|
/botio test |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/eb9a4d1d21c2598/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.215.176.217:8877/d6cab4ff7155aaf/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/eb9a4d1d21c2598/output.txt Total script time: 17.58 mins
|
From: Bot.io (Windows)SuccessFull output at http://54.215.176.217:8877/d6cab4ff7155aaf/output.txt Total script time: 26.03 mins
|
/botio unittest |
From: Bot.io (Linux m4)ReceivedCommand cmd_unittest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/540da94476cb9dd/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_unittest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.215.176.217:8877/e1dcdbbdd14731d/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/540da94476cb9dd/output.txt Total script time: 2.59 mins
|
From: Bot.io (Windows)SuccessFull output at http://54.215.176.217:8877/e1dcdbbdd14731d/output.txt Total script time: 5.26 mins
|
Indeed, no need for that to be a helper function. Thanks! |
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 withnew 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 thePromise.resolve().then(...)
format essentially creates two Promises thus causing additional delay.