src: reduce cpu profiler overhead
authorBen Noordhuis <info@bnoordhuis.nl>
Thu, 29 Jan 2015 17:48:30 +0000 (18:48 +0100)
committerBert Belder <bertbelder@gmail.com>
Wed, 4 Feb 2015 21:19:33 +0000 (22:19 +0100)
commit96ffcb9a210a2fa1248ae5931290193573512a96
tree705f5c5ebe8ad3e9c7820a320c84daaea8246a16
parent3e675e44b59f1be8e5581de000f3cb17ef747c14
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.

The benefits are quite substantial on systems where it is expensive to
query the system time (most virtualized environments). Before, it was
common to see over 20% of wall clock time being spent on clock_gettime()
system calls.

PR: https://github.com/iojs/io.js/pull/466
Reviewed-by: Bert Belder <bertbelder@gmail.com>
src/node.cc