BurntSushi/rebar
View on GitHub ↗ ★ 327 Python
A biased barometer for gauging the relative speed of some regex engines on a curated set of tasks.
44 mentions on Hacker News by 6 people: 3 stories, 41 comments · first 2023-07-05 · latest 2026-05-30
20082026
-
…linear time in the rebar test[0], even if the regex includes capture groups. It's NFA based. [0]: https://github.com/BurntSushi/rebar/pull/20#issuecomment-256...
comment by nitely · 2026-03-23 · in Finding all regex matches has always been O(n²) -
…code in the `regex` crate (and all of its dependencies). Finally, a demonstration of C-like speed: https://github.com/BurntSushi/rebar?tab=readme-ov-file#summa... > Is is a tradeoff, not a silver bullet. Uncontroversial.
comment by burntsushi · 2026-01-06 · in C Is Best (2025) -
…GB/s (1.00x) 34.0 GB/s (1.40x) See also: https://github.com/BurntSushi/memchr/discussions/159 [1]: https://github.com/BurntSushi/rebar [2]: https://github.com/BurntSushi/memchr
comment by burntsushi · 2025-09-23 · in Processing Strings 109x Faster Than Nvidia on H100 -
…required by the `regex` crate. My main focus for the `regex` crate has been on performance: https://github.com/BurntSushi/rebar How does Raku's regex performance compare to Perl?
comment by burntsushi · 2025-07-15 · in Adding lookbehinds to rust-lang/regex -
…of the line implementations in each which beat every other engine save for Intel Hyperscan[0]. [0]: https://github.com/BurntSushi/rebar?tab=readme-ov-file#summa... (note this is without .NET 9 or 10 preview updates)
comment by neonsunset · 2025-05-10 · in Rust’s dependencies are starting to worry me -
…tools from someone experienced in... benchmarking grep tools. :-) (And regexes in general. See: https://github.com/BurntSushi/rebar )
comment by burntsushi · 2025-03-11 · in Show HN: Krep a High-Performance String Search Utility Written in C -
…everything can just be dropped at once. Despite this, it's one of the fastest regex engines around: https://github.com/BurntSushi/rebar#summary-of-search-time-b... Here's a related but more isolated analysis:…
comment by burntsushi · 2025-01-02 · in Static search trees: faster than binary search -
…years old now, but still pretty accurate. For more details at the level of the regex engine, see: https://github.com/BurntSushi/rebar
comment by burntsushi · 2024-11-02 · in Notepad++ is 21 years old -
…of the problem in the first place. That's... a stretch, but probably better than nothing. [1]: https://github.com/BurntSushi/rebar?tab=readme-ov-file#summa... [2]: https://unicode.org/reports/tr18/#Canonical_Equivalents
comment by burntsushi · 2024-09-18 · in Rga: Ripgrep, but also search in PDFs, E-Books, Office documents, zip, etc. -
The C#'s regex engine would have run circles around Go's here though while doing so :) https://github.com/BurntSushi/rebar?tab=readme-ov-file#summa...
comment by neonsunset · 2024-08-12 · in Go is my hammer, and everything is a nail -
…by sljit, is one of the fastest regex engines in existence (according to my own benchmarks): https://github.com/BurntSushi/rebar?tab=readme-ov-file#summa...
comment by burntsushi · 2024-07-09 · in Sljit: Platform independent low-level JIT compiler -
…"NFA algorithm," chaos ensues. [1]: https://www.pcre.org/current/doc/html/pcre2matching.html [2]: https://github.com/BurntSushi/rebar?tab=readme-ov-file#cloud... [3]: https://www.pcre.org/current/doc/html/pcre2matching.html#TOC...
comment by burntsushi · 2024-06-20 · in Wc2: Investigates optimizing 'wc', the Unix word count program -
…into the `memchr` crate's benchmark harness: https://github.com/BurntSushi/memchr It uses rebar: https://github.com/BurntSushi/rebar
comment by burntsushi · 2024-05-21 · in Regular expression matching can be simple and fast (2007) -
…about importing your assumptions about regex performance from one language to another. See also: https://github.com/burntSushi/rebar
comment by hyperpape · 2024-05-21 · in Regular expression matching can be simple and fast (2007) -
…here is pretty small, and even among backtracking regex engines, Java's is pretty slow. See: https://github.com/BurntSushi/rebar?tab=readme-ov-file#summa... The backtracking engines ahead of are pcre2/jit, javascript/v8, d/ldc/std-regex…
comment by burntsushi · 2024-05-08 · in Needle: A DFA Based Regex Library That Compiles to JVM ByteCode -
…as you can’t JIT the IL there. Similar to the blog post, this allows it to be one of the fastest: https://github.com/BurntSushi/rebar?tab=readme-ov-file#summa...
comment by neonsunset · 2024-05-08 · in Needle: A DFA Based Regex Library That Compiles to JVM ByteCode -
https://github.com/BurntSushi/rebar For regex, you can't really distill it down to one single fastest algorithm. It's somewhat similar even for substring search. But certainly, the fastest algorithms are going to be the ones that make use…
comment by burntsushi · 2024-04-16 · in Knuth–Morris–Pratt illustrated -
…slower in a lot of cases, but this is more a property of its implementation than its concept. See: https://github.com/BurntSushi/rebar?tab=readme-ov-file#summa... --- Given "sufficient" implementation effort (~several person years of…
comment by burntsushi · 2024-03-20 · in Regex character "$" doesn't mean "end-of-string" -
Yes, and with more regex engines: https://github.com/BurntSushi/rebar/blob/177f5d55e916964b9c4... Beyond what's in the OP, that includes RE2, Hyperscan, D's std.regex, ICU, Perl, Python's third party `regex` package, and `regress`.
comment by burntsushi · 2024-03-20 · in Regex character "$" doesn't mean "end-of-string" -
The regexp being "not the fastest" might be an understatement: https://github.com/BurntSushi/rebar?tab=readme-ov-file#summa... Nothing that Go has is uniquely better or even competitive. Both C# and Java have way more extensive and…
comment by neonsunset · 2024-03-15 · in More powerful Go execution traces -
…I don't have a good answer for that one. All models are wrong, but, some are useful. [1]: https://github.com/BurntSushi/rebar/blob/96c6779b7e1cdd850b8...
comment by burntsushi · 2023-12-31 · in C# Regex engine is now 3rd fastest in the world -
…the link got trimmed away...or it was OSI layer 8 issue :D Either way, the data is in this comment: https://github.com/BurntSushi/rebar/pull/10#issuecomment-187... .NET now takes 3rd place, behind Mr. Gallant's Regex crate and Intel's…
comment by neonsunset · 2023-12-31 · in C# Regex engine is now 3rd fastest in the world -
…[4]: https://github.com/BurntSushi/ripgrep/blob/master/FAQ.md#why... [5]: https://github.com/BurntSushi/rebar/blob/96c6779b7e1cdd850b8...
comment by burntsushi · 2023-12-31 · in Ugrep – a more powerful, fast, user-friendly, compatible grep -
…the author of either ripgrep or ugrep. As for regex benchmarks, you'll want to check out rebar: https://github.com/BurntSushi/rebar You can see my full thoughts around benchmark design and philosophy if you read the rebar documentation. Be…
comment by burntsushi · 2023-12-31 · in Ugrep – a more powerful, fast, user-friendly, compatible grep -
…the case of \p{Connector_Punctuation}, regex engines will usually at least include underscore. See: https://github.com/BurntSushi/rebar/blob/f9a4f5c9efda069e798... And then there's \p{Letter}. It can be spelled in a lot of ways: \pL,…
comment by burntsushi · 2023-12-30 · in Ugrep – a more powerful, fast, user-friendly, compatible grep -
…om/BurntSushi/memchr#why-is-the-standard-lib... [6]: https://github.com/rust-lang/rfcs/pull/3469 [7]: https://github.com/BurntSushi/rebar#summary
comment by burntsushi · 2023-12-26 · in Ask HN: What's the fastest programming language with a large standard library? -
…look at a regex benchmark that compares engines (perhaps JITs are not the fastest in all cases!): https://github.com/BurntSushi/rebar In particular, the `regex-lite` engine is strictly just the PikeVM without any frills. No prefilters or…
comment by burntsushi · 2023-11-03 · in Translations of Russ Cox's Thompson NFA C Program to Rust -
…throughput on its own. ripgrep for example uses rust/regex. Compare its performance with python/re: https://github.com/BurntSushi/rebar#summary-of-search-time-b...
comment by burntsushi · 2023-09-23 · in Shshsh is a bridge connects Python and shell -
…build step will require emitting a C++ program and compiling it), but it should be possible. [1]: https://github.com/BurntSushi/rebar
comment by burntsushi · 2023-09-14 · in Compile time regular expression in C++ -
…for a variety of tasks. Note that I'm the author of Rust's regex crate and of this regex benchmark: https://github.com/BurntSushi/rebar
comment by burntsushi · 2023-09-13 · in Debugging catastrophic backtracking for regular expressions in Python -
…always high IME it can get pretty bad. > For me the State of the Art is Intel HyperScan. Yes. See https://github.com/BurntSushi/rebar and https://github.com/BurntSushi/aho-corasick/tree/feda22857e1d...
comment by burntsushi · 2023-08-29 · in Stringzilla: Fastest string sort, search, split, and shuffle using SIMD -
…Rust's regex crate being one of the fastest: https://github.com/mariomka/regex-benchmark#optimized https://github.com/BurntSushi/rebar#summary-of-search-time-b... Further, Go refusing to have macros means that many libraries use reflection…
comment by fl0ki · 2023-08-13 · in Rust vs. Go in 2023 -
…Rust. Haha. No. Follow the link to rebar to see performance comparisons. A JIT isn't everything. https://github.com/BurntSushi/rebar
comment by burntsushi · 2023-07-05 · in Regex engine internals as a library -
…I ran out steam adding engines. If anyone wants to take a crack at this, instructions are here: https://github.com/BurntSushi/rebar/blob/master/CONTRIBUTING... Basically, you "just" need to build a Lisp program that accepts a simple format…
comment by burntsushi · 2023-07-05 · in A Regex Barometer -
…finding it hard to say what is "surprising" haha. Perhaps others from the outside can comment. [1]: https://github.com/BurntSushi/rebar#quadratic
comment by burntsushi · 2023-07-05 · in A Regex Barometer -
…noseyparker benchmark for example[1]. It's absolutely brutal and most engines just time out. [1]: https://github.com/BurntSushi/rebar#noseyparker
comment by burntsushi · 2023-07-05 · in A Regex Barometer -
It can. I did it here: https://github.com/BurntSushi/rebar/tree/ag/regexinit/record... And the PR: https://github.com/BurntSushi/rebar/pull/3 Although I probably won't merge it. Overall results: $ rebar rank record/curated/2023-07-05/*.csv…
comment by burntsushi · 2023-07-05 · in A Regex Barometer -
PHP uses PCRE2, which is included in this barometer. I mentioned PHP (among others) here: https://github.com/BurntSushi/rebar/blob/master/WANTED.md If someone has a compelling argument for why PHP specifically (and probably others) should…
comment by burntsushi · 2023-07-05 · in A Regex Barometer