▲ | aarol 5 days ago | |||||||||||||||||||||||||
I'm the author of the post, thanks for your feedback! I was inspired by your comment on HN a while back and started learning about this stuff, reading the source code of `memchr` was especially great. You're totally right about the first part there was a serious consideration to add this to zig's standard library, there would definitely need to be a fallback to avoid the `O(m*n)` situation. I'll admit that there are a lot of false assumptions at the end, you could totally specialize it for u8 and also get the block size according to CPU features at compile time with `std.simd.suggestVectorSize()` | ||||||||||||||||||||||||||
▲ | hansvm 5 days ago | parent [-] | |||||||||||||||||||||||||
Or at runtime, if you'd like. You can create a generic binary that runs faster on supported platforms. | ||||||||||||||||||||||||||
|