Skip to content

perf_hooks: only enable GC tracking when it's requested

Rodrigo Muino Tomonari requested to merge github/fork/joyeecheung/gc-delay into master

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.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

Merge request reports

Loading