3 ms·
Just from futzing around with Benchmark, it looks like the array allocation is the expensive bit. If you're not constantly reallocating the array you're checki
by knowtheory 14y ago
Just from futzing around with Benchmark, it looks like the array allocation is the expensive bit.
If you're not constantly reallocating the array you're checking against, it takes 1.5x more time to run. If you're allocating the array each time it's 3.5-4x more time.
https://gist.github.com/4549975 https://gist.github.com/4549975