You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`Darwin macbookpro.lan 24.3.0 Darwin Kernel Version 24.3.0: Thu Jan 2 20:24:16 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T6000 arm64`
Subsystem
http
What steps will reproduce the bug?
Run the following code in node 20.19 and node 22.14
import{request}from"http"
❯ time node import.mjs
node import.mjs 0.03s user 0.01s system 82% cpu 0.049 total
❯ node --version
v20.19.0
❯ time node import.mjs
node import.mjs 0.04s user 0.05s system 49% cpu 0.176 total
❯ node --version
v22.14.0
How often does it reproduce? Is there a required condition?
Every time.
What is the expected behavior? Why is that the expected behavior?
Node 22.14 uses similar CPU to Node 20.19
What do you see instead?
In Node 22, the same code loads the undici bits which requires a lot more CPU. Node 20 does not.
Additional information
I was investigating a performance regression in coldstart time between Node 20 and Node 22 in the AWS Lambda environment. Between Node 20 and Node 22, there is a +50 ms regression in coldstart performance when you instantiate clients using the AWS Javascript SDK V3. I was able to trace the issue to the clients always importing the node http request library regardless of whether the client used https only.
If you can make the loading of the undici bits lazier, I don't think they are actually needed until you start using the http request itself in certain scenarios and this will address the coldstart performance issue between node 20 and node 22 in the AWS Lambda environment.
The text was updated successfully, but these errors were encountered:
Version
20.19
and22.14
Platform
Subsystem
http
What steps will reproduce the bug?
Run the following code in node 20.19 and node 22.14
How often does it reproduce? Is there a required condition?
Every time.
What is the expected behavior? Why is that the expected behavior?
Node 22.14 uses similar CPU to Node 20.19
What do you see instead?
In Node 22, the same code loads the
undici
bits which requires a lot more CPU. Node 20 does not.Additional information
I was investigating a performance regression in coldstart time between Node 20 and Node 22 in the AWS Lambda environment. Between Node 20 and Node 22, there is a +50 ms regression in coldstart performance when you instantiate clients using the AWS Javascript SDK V3. I was able to trace the issue to the clients always importing the node http request library regardless of whether the client used https only.
If you can make the loading of the
undici
bits lazier, I don't think they are actually needed until you start using the http request itself in certain scenarios and this will address the coldstart performance issue between node 20 and node 22 in the AWS Lambda environment.The text was updated successfully, but these errors were encountered: