Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
generic-random is slower than testing-feat #6
A mail I originally wrote to Maciej Bendkowski, who asked about a note I wrote on this on my personal homepage. I wanted to take some time to tidy and expand more but now I find it okay to publish here at least to whoever is interested.
I believe that Boltzmann samplers make too many rejections, so that even though they are linear in complexity (FEAT isn't quite linear, I think), the constant factor of the complexity is too large.
The cost of computing the oracle shouldn't factor into it because it is done only once (though if it does, it would only make Boltzmann generators look worse). For the record, I have only implemented a
My benchmark is simple: generate binary trees.
The interesting entries are
I run this for
Even though I am in a way cheating, FEAT remains 20 to 30 times faster at sizes < 1000.
I must admit I am not 100% confident about those results and my methodology. I am also unsure about what happens with more complex types. But there is also a theoretical argument that Boltzmann
Indeed, the original paper actually gives a precise estimation of the cost of rejection: (Theorem 7.3) the cumulated size of the rejected objects by the singular rejection sampler is asymptotically equivalent
Using a very loose tolerance helps,