Skip to content

perf(pprof): keep prepared sample arrays - #448

Open
BridgeAR wants to merge 4 commits into
mainfrom
BridgeAR/2026-11-25-prepared-profile-arrays
Open

BridgeAR wants to merge 4 commits into
mainfrom
BridgeAR/2026-11-25-prepared-profile-arrays

Conversation

@BridgeAR

Copy link
Copy Markdown
Member

The serializer already owns the normalized label, sample, and location
arrays. It can use them without asking the codec to walk them again.
Repeated builds through the public builder still copy the profile arrays.

With pprof-format 2.4.1 on Node 24.22.1 Alpine, replaying a 6,113-sample
NestJS wall profile used 13.14 ms of serializer CPU instead of 15.06 ms.
The encoded profile did not change.

Refs: DataDog/dd-trace-js#11136

@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Overall package size

Self size: 3.02 MB
Deduped: 4.14 MB
No deduping: 4.14 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | pprof-format | 2.4.1 | 924.37 kB | 924.37 kB | | source-map | 0.8.0 | 185.66 kB | 185.66 kB | | node-gyp-build | 4.8.4 | 13.86 kB | 13.86 kB |

🤖 This report was automatically generated by heaviest-objects-in-the-universe

@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Pipelines

❌ Errors

Your PR has failed checks. Please review the issues below and take necessary action before merging.

🚦 1 Pipeline job failed

DataDog/apm-reliability/pprof-nodejs | benchmarks-pr-comment

View more details · View in GitLab

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: b90147d | Docs | View more details | Give us feedback!

@BridgeAR BridgeAR added the semver-patch Bug or security fixes, mainly label Nov 25, 2026
@BridgeAR
BridgeAR marked this pull request as ready for review November 25, 2026 18:54
@BridgeAR
BridgeAR force-pushed the BridgeAR/2026-11-25-prepared-profile-arrays branch from 5f03950 to 29742cb Compare November 26, 2026 10:48

@szegedi szegedi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd push back on undefined for lowCardinalityLabels, and would like to see a comment explaining why are we doing this.

Comment thread ts/src/profile-serializer.ts Resolved
Comment thread ts/src/profile-serializer.ts Resolved
@BridgeAR
BridgeAR force-pushed the BridgeAR/2026-11-25-prepared-profile-arrays branch from 29742cb to 2a834ff Compare November 27, 2026 16:53
The serializer already owns the normalized label, sample, and location
arrays. It can use them without asking the codec to walk them again.
Repeated builds through the public builder still copy the profile arrays.

With pprof-format 2.4.1 on Node 24.22.1 Alpine, replaying a 6,113-sample
NestJS wall profile used 13.14 ms of serializer CPU instead of 15.06 ms.
The encoded profile did not change.

Refs: DataDog/dd-trace-js#11136
An omitted label list leaves the cache empty. Array ownership matters
when building the profile, where the one-shot caller can select adoption.
V8 can call the near-heap-limit handler after repeated ineffective
collections while live old-generation usage is below the restore
threshold. It can then restore the original limit before the fixture
reads the extension.
@BridgeAR
BridgeAR force-pushed the BridgeAR/2026-11-25-prepared-profile-arrays branch from 2a834ff to b90147d Compare November 30, 2026 14:13

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver-patch Bug or security fixes, mainly

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants