Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

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: #8791
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
  • Loading branch information
bnoordhuis authored and trevnorris committed Dec 17, 2014
1 parent f75a8ad commit 1eb1e0a
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

1 comment on commit 1eb1e0a

@bnoordhuis
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the record, this change triggers a regression in libuv on Linux systems < 2.6.19. The fix is under way, see libuv/libuv#162. The only affected users are (presumably) people that still run CentOS 5.

Please sign in to comment.