Hacker GitHub

← All repos

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

Mentions per year 44 mentions · busiest year 2023 (22)
20082026
  1. ▲ 3
    Rebar: A biased barometer for gauging the relative speed of some regex engines
    story by tosh · 2026-05-30 · 0 comments
  2. …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...
  3. …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)
  4. …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
  5. …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
  6. …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)
  7. …tools from someone experienced in... benchmarking grep tools. :-) (And regexes in general. See: https://github.com/BurntSushi/rebar )
  8. …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:…
  9. …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
  10. …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
  11. 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
  12. …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...
  13. …"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...
  14. …into the `memchr` crate's benchmark harness: https://github.com/BurntSushi/memchr It uses rebar: https://github.com/BurntSushi/rebar
  15. …about importing your assumptions about regex performance from one language to another. See also: https://github.com/burntSushi/rebar
  16. …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…
  17. …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...
  18. 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
  19. …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…
  20. 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`.
  21. 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
  22. They are extremely fast too (way faster than re2): https://github.com/BurntSushi/rebar?tab=readme-ov-file#summa...
    comment by neonsunset · 2024-02-22 · in Re2c
  23. …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...
  24. …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…
  25. …[4]: https://github.com/BurntSushi/ripgrep/blob/master/FAQ.md#why... [5]: https://github.com/BurntSushi/rebar/blob/96c6779b7e1cdd850b8...
  26. ▲ 5
    C# Regex engine is now 3rd fastest in the world
    story by neonsunset · 2023-12-31 · 2 comments
  27. …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…
  28. …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,…
  29. …om/BurntSushi/memchr#why-is-the-standard-lib... [6]: https://github.com/rust-lang/rfcs/pull/3469 [7]: https://github.com/BurntSushi/rebar#summary
  30. Note that I also imported regex-redux into rebar: https://github.com/BurntSushi/rebar/tree/master/record/all/2... It isn't exactly equivalent to the benchmark game's version. The biggest difference is that it doesn't permit parallelism.…
    comment by burntsushi · 2023-11-17 · in .NET 8
  31. …experience to someone else which shows that it now rivals Go where it's the strongest[1]. [0] https://github.com/BurntSushi/rebar#summary-of-search-time-b... [1] https://github.com/neon-sunset/http-bench
    comment by neonsunset · 2023-11-15 · in .NET 8
  32. …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…
  33. …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
  34. …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++
  35. …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
  36. …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...
  37. …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
  38. …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
  39. …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
  40. …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
  41. …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
  42. 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
  43. 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
  44. ▲ 92
    A Regex Barometer
    story by burntsushi · 2023-07-05 · 16 comments