diff options
-rw-r--r-- | src/node_perf.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/node_perf.cc b/src/node_perf.cc index 5a50223ed5..9c995d3b8d 100644 --- a/src/node_perf.cc +++ b/src/node_perf.cc @@ -272,6 +272,9 @@ void MarkGarbageCollectionEnd(Isolate* isolate, v8::GCCallbackFlags flags, void* data) { Environment* env = static_cast<Environment*>(data); + // If no one is listening to gc performance entries, do not create them. + if (!env->performance_state()->observers[NODE_PERFORMANCE_ENTRY_TYPE_GC]) + return; GCPerformanceEntry* entry = new GCPerformanceEntry(env, static_cast<PerformanceGCKind>(type), |