3 ms·
Just doing simple SIMD compares is as fast on most microarchitectures, and faster on Haswell+. You need to be doing something more involved than simple equalit
by stephencanon 10y ago
Just doing simple SIMD compares is as fast on most microarchitectures, and faster on Haswell+. You need to be doing something more involved than simple equality testing for the SSE4.2 instructions to be beneficial.
- NegativeLatency 10y agothis does lexicographical comparison, not just equality
- masklinn 10y agoIt can do more than just string equality too (the first operand can be treated as a character sequence, a character set, a substring needle or a union of character ranges) Though for all that it's still limited to simplistic comparisons of non-textual strings.
- stephencanon 10y agoIt's no faster at that either. You need to be doing something more interesting like prefix scanning for these instructions to be beneficial.