Skip to content

src: reduce cpu profiler overhead - #466

Closed
bnoordhuis wants to merge 1 commit into
nodejs:v1.xfrom
bnoordhuis:reduce-cpu-profiler-overhead
Closed

bnoordhuis wants to merge 1 commit into
nodejs:v1.xfrom
bnoordhuis:reduce-cpu-profiler-overhead

Conversation

@bnoordhuis

Copy link
Copy Markdown
Member

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.

R=@piscisaureus

@bnoordhuis

Copy link
Copy Markdown
Member Author

@bnoordhuis

Copy link
Copy Markdown
Member Author

This PR seems to cause a regression on the centos5-64 bot. Investigating.

@bnoordhuis

Copy link
Copy Markdown
Member Author

The centos5-64 kernel is old enough that it doesn't support epoll_pwait(). It's possible the fallback path in libuv is not working as expected.

@bnoordhuis

Copy link
Copy Markdown
Member Author

Fix: libuv/libuv#162

@Fishrock123

Copy link
Copy Markdown
Contributor

@bnoordhuis looks like the fixed version of libuv has landed here.

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.
@bnoordhuis
bnoordhuis force-pushed the reduce-cpu-profiler-overhead branch from cfbbf82 to 310ce15 Compare January 29, 2015 17:49
@bnoordhuis

Copy link
Copy Markdown
Member Author

@Fishrock123 Yep. Updated and having the CI check it now: https://jenkins-iojs.nodesource.com/view/iojs/job/iojs+any-pr+multi/130/

@bnoordhuis

Copy link
Copy Markdown
Member Author

CI is happy. R=@piscisaureus?

@Qard

Qard commented Feb 2, 2015

Copy link
Copy Markdown
Member

taps @piscisaureus on the shoulder

@piscisaureus

Copy link
Copy Markdown
Contributor

Oh, oops missed this. LGTM

bnoordhuis added a commit that referenced this pull request Feb 4, 2015
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: #466
Reviewed-by: Bert Belder <bertbelder@gmail.com>
@piscisaureus

Copy link
Copy Markdown
Contributor

Thanks, landed in 96ffcb9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants