src: keep track of env properly in node_perf.cc · nodejs/node@e8da556 · GitHub
Skip to content

Commit e8da556

Browse files
addaleaxMylesBorins
authored andcommitted
src: keep track of env properly in node_perf.cc
Currently, measuring GC timing using `node_perf` is somewhat broken, because Isolates and Node Environments do not necessarily match 1:1; each environment adds its own hook, so possibly the hook code runs multiple times, but since it can’t reliably compute its corresponding event loop based on the Isolate, each run targets the same Environment right now. This fixes that problem by using new overloads of the GC tracking APIs that can pass data to the callback through opaque pointers. PR-URL: #15391 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
1 parent b4ad15b commit e8da556

2 files changed

Lines changed: 26 additions & 15 deletions

File tree

src/node_perf.cc

Lines changed: 19 additions & 15 deletions

src/node_perf.h

Lines changed: 7 additions & 0 deletions

0 commit comments

Comments
 (0)