-
-
Notifications
You must be signed in to change notification settings - Fork 7
Perfomance regression node 16.20.0 -> 18.16.0 #95
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
Comments
@LuisFros Can you share some code on Stackblitz or some repo? Also, are you using the |
I am using the crypto module and already handled the performance issue with #72 |
For your specific usage scenario, it appears that Node.js 18 exhibits a significant performance regression compared to Node.js 16, with a decrease of approximately up to 88% (less requests being processed in the same time frame). A proof of concept would be useful, nonetheless. Could you perhaps try with a custom build of Node.js 18 custom linked to shared OpenSSL 1.1.1: And run your benchmark again to compare the results? |
I haven't tried running the custom build with OpenSSL 1.1.1 since the profiling doesn't show that the perfomance regression is caused by the Unrelated to my issue, I managed to create a reproducible case where there is a significant perfomance regression of a function call being passed down as an argument and then called. EDIT: I forgot to mention that the regression is gone in node |
@LuisFros The regression between 18 and 20 is quite different from the ones I measured some time ago (I didn't publish it anywhere yet). Would you mind sharing the hardware information? Was it a dedicated machine? |
@RafaelGSS
|
Hi, are there any updates on this from the performance team? |
I've been looking into the v20 regression. The issue seems to be caused by this libuv commit which makes libuv to stop accepting concurrent connections in a loop and defers every next incoming connection handling to the next loop iteration. Reverting it, makes v20 to be on par with v18. As explained in the commit, the main reason for this change is that in most of the scenarios we save an extra /cc @bnoordhuis, what are your thoughts? |
I'm willing to believe it impacts a single-process hello world server but I'm ambivalent on whether that's something to optimize for. I'd be interested to see how the cluster module fares with NODE_CLUSTER_SCHED_POLICY=none. A big reason for removing the accept loop is because it results in lopsided load distribution. Node works around that by doing round robin distribution but I don't want to force other libuv users into working around libuv's shortcomings. |
My experience with |
That's true. ab is kind of horrible, wrk is better in just about every aspect. |
Do you think it would be worth replicating the tests with another tool? Is |
I suggest wrk2. |
Hello, are there any updates on this? I think I am seeing a similar degradation while moving from v14 to v20.18.0. Does v22 address this in any capacity? |
@violetviolinist Reading the comments suggests that people are unclear as to whether it is an actual meaningful regression. |
On my application I do not have any noticeable impact from this issue. Could this be connected to the fact the Node.js 18 prefers IPv6 by default? https://x.com/matteocollina/status/1640384245834055680
I've actually updated the services I could to version 22 and it is quite good. |
Running a simple HTTP graphql server and following the guide https://nodejs.org/en/docs/guides/simple-profiling
------------- NODE 16----------------
-------------NODE 18----------------
The text was updated successfully, but these errors were encountered: