Krep

Dev tools

command-line search utility

SHOW HN2025

173points
74comments
#402of 3,837 in 2025
Top 11%of 2025 by points

How HN took it

MixedNo clear lean

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 HN
    • I 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 HN
    • 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 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 HN
    • I 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 HN
    • 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
  • 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 HN
    • 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 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 HN
    • 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 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 HN
    • Was 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 HN
    • 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 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 HN
    • I 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

Category, keywords, summaries and labels on this page were made by AI (Thread Reader v2) and not checked by hand. Each point links to the comments it came from.

Add a badge to your READMEShown on HackerShow
[![Shown on HackerShow](https://hackershow.org/badge.svg)](https://hackershow.org/show/43333946)