Permalink
Please
sign in to comment.
Browse files
perf_hooks: only enable GC tracking when it's requested
Previously a GC prologue callback and a GC epilogue callback are always unconditionally enabled during bootstrap when the `performance` binding is loaded, even when the user does not use the performance timeline API to enable GC tracking. This patch makes the callback addition conditional and only enables them when the user explicitly requests `observer.observe(['gc'])` to avoid the overhead. PR-URL: #25853 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: James M Snell <jasnell@gmail.com>
- Loading branch information...
Showing
with
14 additions
and 4 deletions.
- +9 −1 lib/perf_hooks.js
- +5 −3 src/node_perf.cc
0 comments on commit
e81c6c8