Commit f59f41f
committed
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.1 parent d9066be commit f59f41f
2 files changed
+14
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
273 | 274 | | |
274 | 275 | | |
275 | 276 | | |
| 277 | + | |
| 278 | + | |
276 | 279 | | |
277 | 280 | | |
278 | 281 | | |
| |||
334 | 337 | | |
335 | 338 | | |
336 | 339 | | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
337 | 345 | | |
338 | 346 | | |
339 | 347 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
296 | 296 | | |
297 | 297 | | |
298 | 298 | | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
299 | 302 | | |
300 | | - | |
301 | 303 | | |
302 | 304 | | |
303 | 305 | | |
| |||
416 | 418 | | |
417 | 419 | | |
418 | 420 | | |
| 421 | + | |
| 422 | + | |
419 | 423 | | |
420 | 424 | | |
421 | 425 | | |
| |||
452 | 456 | | |
453 | 457 | | |
454 | 458 | | |
455 | | - | |
456 | | - | |
457 | 459 | | |
458 | 460 | | |
459 | 461 | | |
| |||
0 commit comments