4 ms·
This lookahead is very similar to the "lazy matching" used in Lempel-Ziv compressors! https://fastcompression.blogspot.com/2010/12/parsing-level-1-lazy-matching
by Scaevolus 1y ago
This lookahead is very similar to the "lazy matching" used in Lempel-Ziv compressors! https://fastcompression.blogspot.com/2010/12/parsing-level-1-lazy-matching.html https://fastcompression.blogspot.com/2010/12/parsing-level-1...
Did you compare it to Buzhash? I assume gearhash is faster given the simpler per iteration structure. (also, rand/v2's seeded generators might be better for gear init than mt19937)
- EdSchouten 1y agoYeah, GEAR hashing is simple enough that I haven't considered using anything else. Regarding the RNG used to seed the GEAR table: I don't think it actually makes that much of a difference. You only use it once to generate 2 KB of data (256 64-bit constants). My suspicion is that using some nothing-up-my-sleeve numbers (e.g., the first 2048 binary digits of π) would work as well.
- pbhjpbhj 1y agoThe random number generation could match the first 2048 digits of pi, so if it works with _any_ random number... If it doesn't work with any random number, then some work better than others then intuitively you can find a (or a set of) best seed(s).
- Scaevolus 1y agoRight, just one fewer module dependency using the stdlib RNG.