Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: getsentry/sentry-javascript-profiling-node-binaries
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: getsentry/sentry-javascript-profiling-node-binaries
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: jp/lazy-cpu-profiler
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 1 commit
  • 1 file changed
  • 2 contributors

Commits on Aug 10, 2026

  1. fix: Create CpuProfiler lazily instead of at module load

    v8::CpuProfiler::New was called from the addon's N-API Init, so merely
    requiring the package created the profiler. In eager logging mode that
    constructor walks every compiled function while holding V8's Logger mutex,
    which is not recursive before V8 12.7. If an allocation during that walk
    starts incremental marking, MarkCompactCollector::StartCompaction re-enters
    the mutex via Isolate::AllowsCodeCompaction() and the main thread deadlocks
    against itself (V8 bug 41497149). Every Node <= 22 ships an affected V8, so
    the exposure window was every process start that imported the package.
    
    The profiler is now created on the first profile start. Processes that never
    profile are no longer exposed at all, and the walk is off the startup path.
    
    Measured on a 10k-function app under Node 22.20: require drops from ~246ms to
    ~1ms, with that cost moving to the first startProfiling call. Profile output
    is unchanged.
    
    Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
    JPeer264 and claude committed Aug 10, 2026
    Configuration menu
    Copy the full SHA
    cc6a801 View commit details
    Browse the repository at this point in the history
Loading