[{"data":1,"prerenderedAt":416},["ShallowReactive",2],{"project-43333946":3},{"id":4,"name":5,"line":6,"line_source":7,"title":8,"url":9,"domain":10,"maker":11,"posted_at":12,"year":13,"points":14,"comments":15,"rank_in_year":16,"shown_in_year":17,"top":18,"tier":19,"category":20,"subcategory":21,"format":22,"keywords":23,"reception":28,"sentiment":29,"stance_mix":30,"scored_comments":33,"aspects":34,"strip":43,"post_text":46,"what":47,"said":72,"maker_in_thread":194,"shape":204,"grid":207,"attempts":378,"same_week":379,"maker_shows":342,"maker_hidden":408,"reader_version":409,"card":410},"43333946","Krep","Krep a High-Performance String Search Utility Written in C","title","Show HN: Krep a High-Performance String Search Utility Written in C","https:\u002F\u002Fdavidesantangelo.github.io\u002Fkrep\u002F","davidesantangelo.github.io","daviducolo",1741709563,2025,173,74,402,3837,11,"notable","dev_tools","command-line search utility","cli",[24,25,26,27],"string search","grep alternative","c utility","simd search","mixed",-0.089,{"positive":31,"neutral":18,"mixed":32,"critical":18},4,2,28,{"performance":35,"execution":37,"design":40,"docs":41,"idea":42},{"positive":36,"critical":31},0,{"positive":38,"critical":39},1,7,{"positive":38,"critical":36},{"positive":38,"critical":36},{"positive":38,"critical":36},[38,44,36,36,38,36,36,44,36,44,36,36,36,38,44,38,44,44,38,38,38,44,44,44,44,36,44,36,36,36,44,45,45,44,44,36,36,38,36,44],3,5,null,{"problem":48,"audience":46,"pricing":46,"motivation":58,"time_to_build":46,"stack":64,"openness":70,"stage":71,"team_size":71},{"value":49,"source":50,"evidence":51},"Fast plain-string search in files, as a grep-like utility","maker",[52,55],{"id":53,"by":11,"text":54},"43333994","You can read my blog post about the project at https:\u002F\u002Fdev.to\u002Fdaviducolo\u002Fintroducing-krep-building-a-high-performance-string-search-utility-2pdo",{"id":56,"by":11,"text":57},"43334121","Source Code on GitHub: https:\u002F\u002Fgithub.com\u002Fdavidesantangelo\u002Fkrep",{"value":59,"source":50,"evidence":60},"Personal project to experiment and have fun, per the maker's reply to why not contribute to ripgrep",[61],{"id":62,"by":11,"text":63},"43334868","Because I wanted to experiment and have fun with a personal project that I will evolve",[65],{"value":66,"source":50,"evidence":67},"C",[68],{"id":69},"post","open_source","unknown",{"praise":73,"objections":86,"requests":130,"questions":149,"alternatives":176},[74],{"value":75,"source":76,"evidence":77},"Clean, minimal codebase and easy install process","commenter",[78,82],{"id":79,"by":80,"text":81},"43334513","creaktive","Very cool! The repo is a reference for minimalism. Also, TIL about ifeq in Makefile. So, many thanks!",{"id":83,"by":84,"text":85},"43335253","simlevesque","I love the install process.",[87,98,111,122],{"value":88,"source":76,"evidence":89},"Benchmarks use tiny inputs that mostly measure process startup",[90,94],{"id":91,"by":92,"text":93},"43335306","burntsushi","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…",{"id":95,"by":96,"text":97},"43335277","geocar","Hi David. ``` $ (for x in `seq 1 100000`; do echo 'I am a Test Vector HeLlO World '\"$x\"; done) > \u002Fdev\u002Fshm\u002Fkrep_tmp ``` Best of three runs shown: ``` $ time .\u002Fkrep -i hello…",{"value":99,"source":76,"evidence":100},"Produces incorrect match counts in multiple tests",[101,104,108],{"id":102,"by":92,"text":103},"43334661","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…",{"id":105,"by":106,"text":107},"43334854","danudey","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,…",{"id":109,"by":92,"text":110},"43336004","``` $ echo foo > \u002Ftmp\u002Ftest $ krep -c foo \u002Ftmp\u002Ftest Found 4 matches ```",{"value":112,"source":76,"evidence":113},"No regular expression support despite the grep name",[114,118],{"id":115,"by":116,"text":117},"43336683","groos","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?",{"id":119,"by":120,"text":121},"43335258","torlok","This is only for string matching? I can't find any mentions of regular expression support. Why use the \"re\" naming scheme?",{"value":123,"source":76,"evidence":124},"Fails to build without patch; madvise error needs _GNU_SOURCE",[125,129],{"id":126,"by":127,"text":128},"43334180","forgotpwd16","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…",{"id":102,"by":92,"text":103},[131,135,142],{"value":132,"source":76,"evidence":133},"Add regular expression support",[134],{"id":119,"by":120,"text":121},{"value":136,"source":76,"evidence":137},"Add test cases for chunk boundary handling",[138],{"id":139,"by":140,"text":141},"43335440","kazinator","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,…",{"value":143,"source":76,"evidence":144},"Use runtime CPU feature detection instead of compile-time macros",[145],{"id":146,"by":147,"text":148},"43335889","johnisgood","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…",[150,158,169],{"value":151,"source":76,"evidence":152},"Why are results wrong in simple examples",[153,157],{"id":154,"by":155,"text":156},"43336761","hn_acc1","Do you have an explanation for the obviously wrong answers in simple examples shown here?",{"id":102,"by":92,"text":103},{"value":159,"source":76,"evidence":160},"Was the blog post or code written with an LLM",[161,165],{"id":162,"by":163,"text":164},"43339241","rafram","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.",{"id":166,"by":167,"text":168},"43338161","null_name","Was this comment written by an LLM? What use, if any, did you make of LLMs when writing krep?",{"value":170,"source":76,"evidence":171},"How are disk errors handled with memory-mapped files",[172],{"id":173,"by":174,"text":175},"43339153","malkia","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…",[177,182,187],{"value":178,"source":76,"evidence":179},"ripgrep",[180,181],{"id":126,"by":127,"text":128},{"id":102,"by":92,"text":103},{"value":183,"source":76,"evidence":184},"GNU grep \u002F fgrep",[185,186],{"id":95,"by":96,"text":97},{"id":105,"by":106,"text":107},{"value":188,"source":76,"evidence":189},"the_silver_searcher (ag)",[190],{"id":191,"by":192,"text":193},"43334582","stefanos82","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]…",{"comments":195,"answered":31,"key":196},8,[197,198,201],{"id":53,"text":54},{"id":199,"text":200},"43336635","added https:\u002F\u002Fgithub.com\u002Fdavidesantangelo\u002Fkrep\u002Ftree\u002Fmain\u002Ftest",{"id":202,"text":203},"43334718","thanks, I've just fixed https:\u002F\u002Fgithub.com\u002Fdavidesantangelo\u002Fkrep\u002Fcommit\u002F95ed1853b561396c8a8bcbbdd115ed6273848e3f.",{"commenters":205,"max_depth":39,"maker_replies":195,"first_comment_mins":44,"lifespan_hours":206},40,145,[208,210,214,218,221,223,225,226,228,231,233,237,239,243,246,248,251,255,258,260,262,264,266,268,270,272,274,277,279,280,284,286,287,288,291,293,296,297,300,303,304,306,308,310,313,317,318,321,323,326,329,331,333,335,338,340,345,347,349,350,352,355,357,360,363,367,371,373,377],[146,36,38,209,147,36],"project\u002Fcritical\u002Fperformance",[211,36,44,212,213,36],"43339194","project\u002Fmixed\u002Fperformance","CyberDildonics",[215,36,36,216,217,36],"43339808","commenter\u002Fneutral\u002Fnone","doctorsher",[219,36,36,216,220,36],"43340702","ashvardanian",[222,36,36,216,147,36],"43341726",[53,38,36,224,11,38],"maker\u002Fneutral\u002Fdocs",[95,38,38,209,96,36],[91,38,36,227,92,36],"commenter\u002Fneutral\u002Fperformance",[229,38,36,216,230,36],"43335857","globnomulous",[232,38,36,216,92,36],"43335973",[234,38,36,235,236,36],"43336268","commenter\u002Fcritical\u002Fexecution","fanf2",[238,38,36,216,92,36],"43337371",[240,38,44,241,242,36],"43335647","project\u002Fneutral\u002Fperformance","gwbas1c",[244,38,36,227,245,36],"43337888","lainzhow",[247,38,36,216,242,36],"43338578",[249,38,44,241,250,36],"43337748","MattPalmer1086",[252,38,36,253,254,36],"43342542","other\u002Fneutral\u002Fperformance","rurban",[256,38,36,257,250,36],"43343045","other\u002Fneutral\u002Fnone",[259,38,36,227,250,36],"43345885",[261,38,36,253,250,36],"43347251",[263,38,36,216,254,36],"43347920",[265,38,36,216,250,36],"43352002",[267,38,36,216,254,36],"43390773",[162,38,38,269,163,36],"project\u002Fcritical\u002Fexecution",[139,32,44,271,140,36],"project\u002Fneutral\u002Fexecution",[199,32,36,273,11,38],"maker\u002Fneutral\u002Fnone",[275,32,38,269,276,36],"43337177","scottlamb",[278,32,36,216,140,36],"43338619",[126,44,44,212,127,36],[281,44,44,282,283,36],"43334283","project\u002Fneutral\u002Fnone","mbrubeck",[202,44,36,285,11,38],"maker\u002Fneutral\u002Fexecution",[102,31,38,209,92,36],[105,31,38,269,106,36],[289,31,38,269,290,36],"43335424","jandrese",[292,31,38,209,92,36],"43335511",[294,31,36,216,295,36],"43338802","paulirish",[154,45,44,271,155,36],[298,45,38,269,299,36],"43337844","KTibow",[79,301,45,302,80,36],6,"project\u002Fpositive\u002Fdesign",[56,39,36,282,11,38],[115,195,44,305,116,36],"project\u002Fneutral\u002Fdocs",[307,195,36,216,147,36],"43336711",[173,309,44,271,174,36],9,[311,312,36,273,11,38],"43341045",10,[314,18,45,315,316,36],"43335827","project\u002Fpositive\u002Fidea","jurschreuder",[109,18,38,269,92,36],[319,18,36,257,320,36],"43339438","oguz-ismail",[322,18,36,257,92,36],"43339469",[324,18,36,257,325,36],"43341077","PhilipRoman",[327,18,36,257,328,36],"43344138","blueflow",[330,18,36,257,325,36],"43347365",[332,18,36,257,320,36],"43347475",[334,18,44,271,127,36],"43341206",[83,336,45,337,84,36],12,"project\u002Fpositive\u002Fdocs",[339,336,36,257,147,36],"43336366",[341,342,45,343,344,36],"43336001",13,"project\u002Fpositive\u002Fexecution","OhMeadhbh",[119,346,44,305,120,36],14,[348,346,36,224,11,38],"43335297",[166,346,44,273,167,36],[351,346,36,257,230,36],"43359584",[353,346,36,354,11,38],"43335300","project\u002Fneutral\u002Fidea",[191,356,36,257,192,36],15,[358,356,36,257,359,36],"43335153","tom_",[361,356,36,253,362,36],"43335298","nicce",[364,365,38,269,366,36],"43358358",16,"buggz2k",[368,369,36,257,370,36],"43334246",17,"deepanwadhwa",[372,369,36,257,250,36],"43337891",[374,375,44,354,376,36],"43334794",18,"oulipo",[62,375,36,354,11,38],[],[380,385,390,395,399,403],{"id":381,"name":382,"points":383,"category":384},"43331582","Factorio Learning Environment",749,"ai",{"id":386,"name":387,"points":388,"category":389},"43328095","Seven39",735,"consumer_social",{"id":391,"name":392,"points":393,"category":394},"43347306","Time Portal",497,"games",{"id":396,"name":397,"points":398,"category":20},"43280615","CodeTracer",334,{"id":400,"name":401,"points":402,"category":389},"43304785","daale.club",302,{"id":404,"name":405,"points":406,"category":407},"43333661","Pila",301,"hardware",false,"v2",{"id":411,"name":5,"line":6,"ai":408,"cat":20,"year":13,"points":14,"comments":15,"rec":28,"s":412,"top":18,"kw":413,"maker":11,"domain":10,"tier":19,"attempts":36,"strip":414,"url":9,"mix":415,"praise":75,"objection":88,"sub":21},43333946,-0.09,[24,25,26,27],"1300100303000131331113333030003553300103",[31,18,32,18],1794036671071]