News for hackers. Stuff that matters.
Re:Optimizating Rabin-Karp Hashing by perihelions on Saturday March 09, 2024 @09:14AM (#39651669)
I wonder what a designed-for-SIMD rolling hash would look like. Like—just a trivial toy experiment—suppose hash ↤ (hash * input[j]) << 1. That's a (very crappy) rolling-hash function with a window size of sizeof(hash). It's also algebraically equivalent to hash ↤ hash * (input[j] << 1), which is a parallelizable horizontal-product over the input bytevector. This shows that you can keep the "rolling window" property, without the "evaluates serially from left-to-right" requirement: it's possible to rearrange things algebraically so that the "folding" step can be evaluated in any order.

Are there nontrivial constructions with this property?

There are no comments on this comment yet.