-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
Promise performance drop between v8 7.4 and 7.5 #33384
Comments
Out of curiosity, did you try the master branch, which now has V8 8.3? |
The following download has V8 8.3 if you want to test it: https://nodejs.org/download/nightly/v15.0.0-nightly202005135bb4d01fbe/ |
This issue is being addressed here https://bugs.chromium.org/p/v8/issues/detail?id=10550 |
After some investigation I found the root cause: V8 changed the default page size from 512 KiB (v7.4) to 256 KiB (v7.5) Some background:
Take-away:
|
FYI, to underly my comment about measuring the right thing: |
Thanks you very much @camillobruni for all these explanations! I submitted a PR in Bluebird to fix those benchmarks and another one in Node.js to add a direct access to the rss. Also updated the original article at https://blog.kuzzle.io/bluebird-native-async_await-javascript-promises-performances-2020 |
Hey, I totally missed this issue - cool investigation I'll take a look at the bluebird issue. Note that:
|
@benjamingr I believe you're referring to these benchmarks? |
Accessing the rss value through memoryUsage() can be expensive because this method will also generate memory usage statistics by iterating on each page. This commit intend to offer a more direct access to rss value. Refs: #33384 PR-URL: #34291 Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: James M Snell <jasnell@gmail.com>
The cause of the issue has been identified: the A new fast access to the rss has been implemented and will land on the next Node.js release: |
Accessing the rss value through memoryUsage() can be expensive because this method will also generate memory usage statistics by iterating on each page. This commit intend to offer a more direct access to rss value. Refs: #33384 PR-URL: #34291 Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: James M Snell <jasnell@gmail.com>
Accessing the rss value through memoryUsage() can be expensive because this method will also generate memory usage statistics by iterating on each page. This commit intend to offer a more direct access to rss value. Refs: #33384 PR-URL: #34291 Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: James M Snell <jasnell@gmail.com>
Accessing the rss value through memoryUsage() can be expensive because this method will also generate memory usage statistics by iterating on each page. This commit intend to offer a more direct access to rss value. Refs: #33384 PR-URL: #34291 Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: James M Snell <jasnell@gmail.com>
Accessing the rss value through memoryUsage() can be expensive because this method will also generate memory usage statistics by iterating on each page. This commit intend to offer a more direct access to rss value. Refs: #33384 PR-URL: #34291 Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: James M Snell <jasnell@gmail.com>
Accessing the rss value through memoryUsage() can be expensive because this method will also generate memory usage statistics by iterating on each page. This commit intend to offer a more direct access to rss value. Refs: nodejs#33384 PR-URL: nodejs#34291 Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: James M Snell <jasnell@gmail.com>
I was doing some benchmark about promises performances and I noticed a performance drop in traditional promises (
then
/catch
) between Node.js 10 and Node.js 12.With further investigation I'm now able to say that the performance drop occur between v8
7.4
(Node.js12.0.0
) and v87.5
(Node.js12.5.0
).The performance drop is still present in recent version of v8 (tested with v8
8.1
on Node.js14.2.0
)Promises are between 3x and 5x slower in v8
7.5
than in v87.4
and they are still 2x slower in v88.1
Do you have any idea why?
If we look at the bigger picture, we can see that promise performance were much more better at some point (Node.js 10) and then start to deteriorate
You can run the script present on this Gist to reproduce the benchmarks: https://gist.github.com/Aschen/1d35ccb6dc1dc3d6796b00cecfebb6d0
The text was updated successfully, but these errors were encountered: