Skip to content

Choosing CPU sampling interval #801

Closed Answered by emeryberger
sandbubbles asked this question in Q&A
Discussion options

You must be logged in to vote

10ms is pretty standard for sampling profilers: it's the default interval used by Go, VTune, and the async profiler for Java. Py-spy also uses a 10ms rate. We also used 10ms in our Coz causal profiler.

This rate empirically strikes a sweet spot providing high accuracy and low overhead (for Scalene, see the graph of Figure 5 from our OSDI paper demonstrating that Scalene's choice delivers high accuracy).

There are a few notable departures from this default: v8's profiler uses a 1ms interval. I just tried perf and while the linked page says it uses a 1ms interval, on my system, it was more like 0.2ms. Austin also uses a default of 0.1ms.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@sandbubbles
Comment options

@emeryberger
Comment options

@emeryberger
Comment options

Answer selected by sandbubbles
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants