Show HN

Huntclaw

by @tiger-langer

Huntclaw – a fast (maybe fastest) simple find-and-replace utility Hello everyone, I’d like to introduce huntclaw—a find-and-replace utility written in Zig that turned out to be faster than sd (written in Rust) and the standard GNU utilities. (benchmark as .png and .py script available on github repo, you can verify the accuracy of the benchmark: I've uploaded the test to the repository, including the better tests.) There’s a fairly simple explanation for this high speed: the lack of a regex engine and a focus on speed itself, but I don’t think that’s a bad thing. Note that searching is also very fast, thanks to SIMD two-byte prefiltering, which is also implemented in huntclaw. The benchmark also shows that ripgrep is faster at sparse searches, which makes sense, since it’s an excellent utility with SIMD pre-filtering and optimizations far superior to huntclaw—though the gap isn’t that big. I look forward to your feedback or comments. Thanks for reading!

Discover more builders

Builderlust is an endless, joyful scroll of real projects people are shipping right now. Get the app to keep finding your next spark of inspiration.

📱 Coming soon to iOS & AndroidOpen in the app