Krep
Dev tools
command-line search utility
SHOW HN2025
How HN took it
4 positive, 11 neutral or asking, 2 mixed, 11 critical, out of 28 comments about the project. Thread score -0.09.
Execution: 1 for, 7 againstPerformance: 0 for, 4 againstDesign: 1 for, 0 againstDocs: 1 for, 0 againstIdea: 1 for, 0 against
The thread, comment by comment
Each row is a top-level comment and its replies, in HN's order. Select a cell to open that comment on HN.
positive neutral or mixed critical about another commenter or something else the maker
What HN said
What people liked
Clean, minimal codebase and easy install process
From 2 comments
Very cool! The repo is a reference for minimalism. Also, TIL about ifeq in Makefile. So, many thanks!
creaktive on HNI love the install process.
simlevesque on HN
Objections
Benchmarks use tiny inputs that mostly measure process startup
From 2 comments
Consider using a bigger haystack. Your timings are so short that you're mostly just measuring the overhead of running a process. This is relevant to krep because it spawns…
burntsushi on HNHi David. ``` $ (for x in `seq 1 100000`; do echo 'I am a Test Vector HeLlO World '"$x"; done) > /dev/shm/krep_tmp ``` Best of three runs shown: ``` $ time ./krep -i hello…
geocar on HN
Produces incorrect match counts in multiple tests
From 3 comments
This wouldn't build for me, so I had to apply the patch suggested by a sibling comment. Once I got it building, my first benchmark attempt shows it as being slower: ``` $ curl…
burntsushi on HNI had a similar experience, but testing by running `strings` on the Steam Deck repair image (the largest file I had handy) to create a 203 MB strings file with 34,206,436 lines,…
danudey on HN``` $ echo foo > /tmp/test $ krep -c foo /tmp/test Found 4 matches ```
burntsushi on HN
No regular expression support despite the grep name
From 2 comments
Minor nit: the "re" part of grep stands for "regular expression". That doesn't seem to be the case with krep so it's a bit misnamed maybe?
groos on HNThis is only for string matching? I can't find any mentions of regular expression support. Why use the "re" naming scheme?
torlok on HN
Fails to build without patch; madvise error needs _GNU_SOURCE
From 2 comments
Homepage shows it significantly faster than ripgrep. Impressive. Would like to see how it compares across the entire ripgrep's benchmark suite[1], which also includes a few other…
forgotpwd16 on HNThis wouldn't build for me, so I had to apply the patch suggested by a sibling comment. Once I got it building, my first benchmark attempt shows it as being slower: ``` $ curl…
burntsushi on HN
Requests
Add regular expression support
From 1 comment
This is only for string matching? I can't find any mentions of regular expression support. Why use the "re" naming scheme?
torlok on HN
Add test cases for chunk boundary handling
From 1 comment
Where are the test cases? E.g. the chunk boundary stuff in the multi-threaded file search is something that would make me nervous. It brings new edge cases into a simple search,…
kazinator on HN
Use runtime CPU feature detection instead of compile-time macros
From 1 comment
Those CPU features (AVX2 and whatnot) need to be detected at runtime, too, however. Those ifdefs only detect if the compiler supports them, i.e. at build-time only. So... your…
johnisgood on HN
Questions
Why are results wrong in simple examples
From 2 comments
Do you have an explanation for the obviously wrong answers in simple examples shown here?
hn_acc1 on HNThis wouldn't build for me, so I had to apply the patch suggested by a sibling comment. Once I got it building, my first benchmark attempt shows it as being slower: ``` $ curl…
burntsushi on HN
Was the blog post or code written with an LLM
From 2 comments
Was this entire blog post written by AI too? Honestly, this is an impressive feat if so, but the fake benchmarks are really not a good look.
rafram on HNWas this comment written by an LLM? What use, if any, did you make of LLMs when writing krep?
null_name on HN
How are disk errors handled with memory-mapped files
From 1 comment
How do you handle disk errors and file mapping? To give more context, if there is a disk error (logical, physical, etc.), an "fread" would simply return an error, it won't…
malkia on HN
Alternatives named
ripgrep
From 2 comments
Homepage shows it significantly faster than ripgrep. Impressive. Would like to see how it compares across the entire ripgrep's benchmark suite[1], which also includes a few other…
forgotpwd16 on HNThis wouldn't build for me, so I had to apply the patch suggested by a sibling comment. Once I got it building, my first benchmark attempt shows it as being slower: ``` $ curl…
burntsushi on HN
GNU grep / fgrep
From 2 comments
Hi David. ``` $ (for x in `seq 1 100000`; do echo 'I am a Test Vector HeLlO World '"$x"; done) > /dev/shm/krep_tmp ``` Best of three runs shown: ``` $ time ./krep -i hello…
geocar on HNI had a similar experience, but testing by running `strings` on the Steam Deck repair image (the largest file I had handy) to create a 203 MB strings file with 34,206,436 lines,…
danudey on HN
the_silver_searcher (ag)
From 1 comment
It's weird that the_silver_searcher, also known as `ag` [1] is not mentioned in benchmarks, which is also implemented in C. I wonder why... [1]…
stefanos82 on HN