Using a more efficient string matching algorithm

I am semi-passively (e.g. not full-time, or even part-time, but I work on it here and there), and was specifically experimenting with the memchr::memmem impl some last week. One major issue with it is that that code is that memchr::memmem assumes the existence of efficient movemsk-style instruction, which doesn't exist on arm/aarch64 (and emulating it is as slow as emulating horizontal ops generally are). Generally algorithms need to be tweaked to avoid it.

I've been meaning to bring this up on memchr::memmem, but wasn't sure where. (Also, sadly, I don't have tons of time to dedicate to this, but it is an area I am interested in)

2 Likes