Timesliced reservoir sampling: a new(?) algorithm for profilers

Read Original

This article discusses reservoir sampling algorithms for extracting random samples from event streams of unknown length, with a focus on performance profilers. It covers basic reservoir sampling for one or multiple items, highlights problems with standard approaches when a timeline is needed, and introduces a novel 'timesliced' variant that ensures samples are spread evenly across time. The article includes Python code examples and explains why random sampling works for identifying slow code.

Timesliced reservoir sampling: a new(?) algorithm for profilers

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser