Browse Source

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 https://github.com/libuv/libuv#15.

Ref: https://github.com/strongloop/strong-agent/issues/3
PR-URL: https://github.com/joyent/node/pull/8791
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
v0.10.35-release
Ben Noordhuis 10 years ago
committed by Trevor Norris
parent
commit
1eb1e0a9af
  1. 1
      src/node.cc

1
src/node.cc

@ -2962,6 +2962,7 @@ char** Init(int argc, char *argv[]) {
V8::SetFlagsFromCommandLine(&v8argc, v8argv, false); V8::SetFlagsFromCommandLine(&v8argc, v8argv, false);
#ifdef __POSIX__ #ifdef __POSIX__
uv_loop_configure(uv_default_loop(), UV_LOOP_BLOCK_SIGNAL, SIGPROF);
// Ignore SIGPIPE // Ignore SIGPIPE
RegisterSignalHandler(SIGPIPE, SIG_IGN); RegisterSignalHandler(SIGPIPE, SIG_IGN);
RegisterSignalHandler(SIGINT, SignalExit); RegisterSignalHandler(SIGINT, SignalExit);

Loading…
Cancel
Save