mirror of https://github.com/lukechilds/node.git
Browse Source
Reduce the overhead of the CPU profiler by replacing sched_yield() with nanosleep() in V8's tick event processor thread. The former only yields the CPU when there is another process scheduled on the same CPU. Before this commit, the thread would effectively busy loop and consume 100% CPU time. By forcing a one nanosecond sleep period rounded up to the task scheduler's granularity (about 50 us on Linux), CPU usage for the processor thread now hovers around 10-20% for a busy application. PR-URL: https://github.com/joyent/node/pull/8789 Ref: https://github.com/strongloop/strong-agent/issues/3 Reviewed-by: Trevor Norris <trev.norris@gmail.com>v0.10.36-release
committed by
Trevor Norris
7 changed files with 7 additions and 26 deletions
Loading…
Reference in new issue