If you only look at the article this is true. However, the source code is freely available: https://github.com/lemire/Code-used-on-Daniel-Lemire-s-blog/...
If you only look at the article this is true. However, the source code is freely available: https://github.com/lemire/Code-used-on-Daniel-Lemire-s-blog/...
It's a 6 years old system, fastest times are in the 25ns range
- 2-wise+ is 5% slower than 2-wise
- 3-wise is 46% slower than 2-wise
- 3-wise is 39% slower than 2-wise+
on the M1
- 2-wise+ is 40% slower than 2-wise
- 3-wise is 46% slower than 2-wise
- 3-wise is 4% slower than 2-wise+
- 2-wise+ is 19% slower than 2-wise
- 3-wise is 48% slower than 2-wise
- 3-wise is 25% slower than 2-wise+
However, as mentioned in the post the numbers can vary a lot, and I noticed a maximum run-to-run difference of 23ms on two-wise.
$ ./two_or_three
N = 1000000000, 953.7 MB
starting experiments.
two : 53.3 ns
two+ : 60.1 ns
three: 78.6 ns
bogus 1375316400
------
2+ 12% slower than 2
3-wise 47% slower than 2
3-wise 30% slower than 2+
-------
Ratios aside, that's an interesting speed leap when the article gets 9 ms for 2-wise. Mind, the laptop had lots of applications running, i didn't clear it up to do a proper benchmark, but still.
two : 97.4 ns
two+ : 97.9 ns
three: 145.8 ns