sentry-cocoa icon indicating copy to clipboard operation
sentry-cocoa copied to clipboard

fix: use prime sample rate to reduce profiler lock-step potential

Open armcknight opened this issue 3 years ago • 0 comments

:scroll: Description

We simply change the profiler's internal sampling rate from 100 to 101 (a prime number).

:bulb: Motivation and Context

This reduces the potential for lock-step problems. With a composite number, it's possible for repeated subroutines with durations that are divisors of the sample rate to occur in phase with the sampler's starting and/or stopping, which can produce misleading results.

:green_heart: How did you test it?

:pencil: Checklist

  • [x] I reviewed the submitted code ~- [ ] I added tests to verify the changes~ ~- [ ] I updated the docs if needed~ ~- [ ] Review from the native team if needed~
  • [x] No breaking changes

:crystal_ball: Next steps

armcknight avatar Aug 10 '22 01:08 armcknight