Skip to content
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

[BUG]: Severe performance degradation on Node 22 #5360

Open
mrgrain opened this issue Mar 4, 2025 · 0 comments
Open

[BUG]: Severe performance degradation on Node 22 #5360

mrgrain opened this issue Mar 4, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@mrgrain
Copy link

mrgrain commented Mar 4, 2025

Tracer Version(s)

5.40.0

Node.js Version(s)

22.14.0

Bug Report

On Node 22 tracing performance when loading the aws-cdk-lib package is severely impacted. For more complex CDK applications, this gets much worst. We have customers reporting an increase from 2 min to over 30 min.

hyperfine -w5 "node20 dd-trace.js" "node22 dd-trace.js"
Benchmark 1: node20 dd-trace.js
  Time (mean ± σ):      1.388 s ±  0.015 s    [User: 1.470 s, System: 0.104 s]
  Range (min … max):    1.361 s …  1.405 s    10 runs
 
Benchmark 2: node22 dd-trace.js
  Time (mean ± σ):      8.826 s ±  0.124 s    [User: 9.143 s, System: 0.479 s]
  Range (min … max):    8.646 s …  9.022 s    10 runs
 
Summary
  node20 dd-trace.js ran
    6.36 ± 0.11 times faster than node22 dd-trace.js

Note that even for node20 performance is kind of slow. Running DD_TRACE_ENABLED=false node22 dd-trace.js brings the execution time up again.

Reproduction Code

Save as dd-trace.js

require('dd-trace').init();
const cdk = require('aws-cdk-lib');

const app = new cdk.App();
for (let i = 0; i < 1000; i++) { // simulate a large CDK app
  new cdk.Stack(app, `DdTraceStack${i}`);
}

Error Logs

No response

Tracer Config

No response

Operating System

Darwin Kernel Version 24.3.0

Bundling

Unsure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant