You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, every time a Dist is sampled, a new rand_distr distribution is created and subsequently discarded. Since sampling distributions is a major factor in Maybenot's runtime, it may be desirable to change this.
With one exception, all distributions currently included in the framework have a constant-time new function - some simply check parameter validity and return an instance of the relevant struct (e.g. Normal), and others require some additional logic (e.g. Beta and Poisson). The Geometric distribution has a new function whose runtime depends on the shape parameter, but only a few loop iterations should occur, even with very small probabilities.
From the above, there may be minimal benefit to storing a persistent rand_distr distribution in each Dist, also because this would make the Dist type's size dynamic. Benchmark tests with a prototype implementation may shed more light on this.
The text was updated successfully, but these errors were encountered:
Right now, every time a
Dist
is sampled, a newrand_distr
distribution is created and subsequently discarded. Since sampling distributions is a major factor in Maybenot's runtime, it may be desirable to change this.With one exception, all distributions currently included in the framework have a constant-time
new
function - some simply check parameter validity and return an instance of the relevant struct (e.g. Normal), and others require some additional logic (e.g. Beta and Poisson). The Geometric distribution has anew
function whose runtime depends on the shape parameter, but only a few loop iterations should occur, even with very small probabilities.From the above, there may be minimal benefit to storing a persistent
rand_distr
distribution in eachDist
, also because this would make theDist
type's size dynamic. Benchmark tests with a prototype implementation may shed more light on this.The text was updated successfully, but these errors were encountered: