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: nodejs/node
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: e31193da3d43935d727db6788722cbb3c558f63b
Choose a base ref
...
head repository: nodejs/node
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: a293ec778547bd943fc243d5682d0de452897b45
Choose a head ref
  • 3 commits
  • 7 files changed
  • 1 contributor

Commits on Sep 20, 2026

  1. perf_hooks: fix PerformanceObserver observer count leaks

    Observing the same entry type more than once on a PerformanceObserver,
    through repeated `observe({ type })` calls or duplicates in
    `entryTypes`, incremented the internal observer count each time, while
    `disconnect()` decremented it only once per observed type. The counts
    never returned to zero, so GC tracking stayed installed, and entries
    for types such as `'http'` and `'dns'` kept being created after all
    observers had disconnected.
    
    Count each entry type at most once per observer.
    
    Assisted-by: OpenCode
    Signed-off-by: James M Snell <jasnell@gmail.com>
    PR-URL: #66097
    Reviewed-By: Xuguang Mei <meixuguang@gmail.com>
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    jasnell authored and nodejs-github-bot committed Sep 20, 2026
    Configuration menu
    Copy the full SHA
    4290a2d View commit details
    Browse the repository at this point in the history
  2. perf_hooks: track GC callback installation natively

    Whether the V8 GC callbacks used for `'gc'` performance entries were
    installed was tracked by a boolean in JavaScript, separately from the
    native state, and the two could get out of sync. After deserializing a
    user-land snapshot built while a `'gc'` PerformanceObserver was active,
    the boolean claimed the callbacks were installed, although V8 GC
    callbacks do not survive a snapshot. Observing `'gc'` again did not
    install them, and disconnecting removed callbacks that had never been
    registered, crashing the process.
    
    Track the installation state in `PerformanceState` instead, and replace
    the install and remove bindings with a single idempotent
    `updateGarbageCollectionTracking()` binding, which registers the
    callbacks if and only if there are `'gc'` observers.
    
    Assisted-by: OpenCode
    Signed-off-by: James M Snell <jasnell@gmail.com>
    PR-URL: #66097
    Reviewed-By: Xuguang Mei <meixuguang@gmail.com>
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    jasnell authored and nodejs-github-bot committed Sep 20, 2026
    Configuration menu
    Copy the full SHA
    1055987 View commit details
    Browse the repository at this point in the history
  3. perf_hooks: restore GC tracking after snapshot deserialization

    V8 GC callbacks do not survive a snapshot, so a `'gc'`
    PerformanceObserver that was active while building a user-land
    snapshot received no entries after deserialization, unless another
    `'gc'` observer was created.
    
    When `'gc'` is observed while building a snapshot, add a deserialize
    callback that registers the GC callbacks again if `'gc'` observers are
    still active.
    
    Assisted-by: OpenCode
    Signed-off-by: James M Snell <jasnell@gmail.com>
    PR-URL: #66097
    Reviewed-By: Xuguang Mei <meixuguang@gmail.com>
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    jasnell authored and nodejs-github-bot committed Sep 20, 2026
    Configuration menu
    Copy the full SHA
    a293ec7 View commit details
    Browse the repository at this point in the history
Loading