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.js 12.0.0) and v8 7.5 (Node.js 12.5.0).
The performance drop is still present in recent version of v8 (tested with v8 8.1 on Node.js 14.2.0)
Promises are between 3x and 5x slower in v8 7.5 than in v8 7.4 and they are still 2x slower in v8 8.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
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/
@mscdex I updated the benchmark and the script to use the version @targos linked and the results are worse with the latest version of Node.js / v8
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:
process.memoryUsage()Take-away:
FYI, to underly my comment about measuring the right thing:
Commenting out the memMax = Math.max(memMax, process.memoryUsage().rss); line in performance.js makes the benchmark run 3x faster in node v12.5.
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
@ryzokuken
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?
Most helpful comment
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:
process.memoryUsage()Take-away: