4 ms·
That was a fun read, I liked the use of cmbc to validate the algorithm. For those who are interested, there's a good tool to specifically test string searching
by MattPalmer1086 6y ago
That was a fun read, I liked the use of cmbc to validate the algorithm.
For those who are interested, there's a good tool to specifically test string searching algorithms here:
https://github.com/smart-tool/smart https://github.com/smart-tool/smart
There are so many string searching algorithms now, with different best and worst cases. Some work better on low alphabets (eg DNA), some are better for text or high entropy data, some take advantage of CPU instructions, some are generic. The real challenge is picking the right algorithm.
I've implemented a few of them in java here, and extended them to support multi byte matching at any position:
https://github.com/nishihatapalmer/byteseek https://github.com/nishihatapalmer/byteseek