News for hackers. Stuff that matters.
Re:Are your memory-bound benchmarking timings normally distr... by darksaints on Friday April 07, 2023 @10:36AM (#35481992)
There's a pretty good section on the natural occurrences and applications of the distribution in the wikipedia article.

https://en.wikipedia.org/wiki/Gamma_distribution#Occurrence_...

Re:Are your memory-bound benchmarking timings normally distr... by nextaccountic on Friday April 07, 2023 @11:43AM (#35482852)
> Consider a sequence of events, with the waiting time for each event being an exponential distribution with rate β

Why is the exponential distribution of waiting times a reasonable assumption in this case?

Re:Are your memory-bound benchmarking timings normally distr... by bick_nyers on Friday April 07, 2023 @12:07PM (#35483177)
Yeah that is what I can't figure out
Re:Are your memory-bound benchmarking timings normally distr... by darksaints on Friday April 07, 2023 @01:27PM (#35484285)
In the general case? Because the exponential distribution is directly the result of a poisson process, and poisson processes are also naturally ubiquitous.

In the case of memory-bound code benchmarking? Because memory access in NUMA architectures with tiered caches are approximately exponential: L1 vs L2 vs L3 vs main memory vs swap are all exponential increases in latencies. It's obviously more of a step function than a continuous function but the relationship is definitely exponential.

The pages for the exponential distribution and poisson process are also informative and interesting.

https://en.wikipedia.org/wiki/Exponential_distribution#Occur...

https://en.wikipedia.org/wiki/Poisson_point_process#History

When I go through the process of finding an appropriate distribution, I usually first look through wikipedia to see if I can find conceptual parallels, just like this. That doesn't mean I settle on it..I'll usually test the distribution fit with functions like those found in fitdistr plus, as well as test to see if residuals are roughly normally distributed.

One hard and fast rule that I use though is that I never use an unbounded distribution to model a bounded process. For compute times, you can't have negative latencies, and you can't have zero latencies, but you can have infinite latencies. Therefore, I would only consider using distributions in the space of (0,infinity]. The log normal distribution fits this and is probably adequate here, but the gamma distribution might be a smidge better.

https://cran.r-project.org/web/packages/fitdistrplus/vignett...