From ac129fe548b2224bc22ae9eae54815cde44a4f31 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Thu, 27 Nov 2014 09:10:21 +0100 Subject: [PATCH] src: reduce cpu profiler overhead Reduce the overhead of the CPU profiler by suppressing SIGPROF signals when sleeping / polling for events. Avoids unnecessary wakeups when the CPU profiler is active. Depends on libuv/libuv#15. Refs strongloop/strong-agent#3 and strongloop-internal/scrum-cs#37. --- src/node.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/node.cc b/src/node.cc index e80c1a573f50..6d4d212bfb72 100644 --- a/src/node.cc +++ b/src/node.cc @@ -2962,6 +2962,7 @@ char** Init(int argc, char *argv[]) { V8::SetFlagsFromCommandLine(&v8argc, v8argv, false); #ifdef __POSIX__ + uv_loop_configure(uv_default_loop(), UV_LOOP_BLOCK_SIGNAL, SIGPROF); // Ignore SIGPIPE RegisterSignalHandler(SIGPIPE, SIG_IGN); RegisterSignalHandler(SIGINT, SignalExit);