News for hackers. Stuff that matters.
Re:Is Prefix of String in Table? a Journey into SIMD String... by trentnelson on Monday May 14, 2018 @11:45AM (#17066444)
The article is much longer than I originally anticipated. If you're looking for some good bits, you could probably jump straight to here: http://trent.me/is-prefix-of-string-in-table/#IsPrefixOfStri...

That discusses the last C implementation before I took a stab at the assembly versions.

The final assembly section was pretty juicy as well: http://trent.me/is-prefix-of-string-in-table/#IsPrefixOfStri....

I was investigating why an earlier assembly version was so slow, then ended up writing a version that unequivocally beat all the C and previous assembly versions across the board (both prefix and negative matching, and worst case false-positive matching (where up to three comparisons needed to be done)).

TL;DR with optimized data structures specifically geared toward SIMD instructions, you can definitely get sizable performance improvements in both C with intrinsics, and then again with raw assembly.

There are no comments on this comment yet.