Unverified Commit 475c43c1 authored by Joyee Cheung's avatar Joyee Cheung Committed by Anna Henningsen
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: https://github.com/nodejs/node/pull/25853


Reviewed-By: default avatarAnna Henningsen <anna@addaleax.net>
Reviewed-By: default avatarGus Caplan <me@gus.host>
Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
parent cc5de5a5
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment