Skip to content

Commit

Permalink
src: reduce cpu profiler overhead
Browse files Browse the repository at this point in the history
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: strongloop/strong-agent#3
PR-URL: nodejs#8791
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
  • Loading branch information
bnoordhuis authored and mscdex committed Dec 25, 2014
1 parent 116e875 commit ecc89b7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ecc89b7

Please sign in to comment.