|
|
|
|
|
by burntsushi
1084 days ago
|
|
I agree. I did not expect .NET to do so well. Another surprise is perhaps the quadratic benchmark[1]. Even for automata oriented engines, it provokes a case that is unavoidably O(m * n^2). Basically, the automata oriented engines (rust/regex, go/regexp and re2) all have worst case O(m * n) time complexity for an individual search. But when you move to "iterate over all matches in a haystack," that worst case gets bumped up to O(m * n^2) for certain classes of regexes. All regex engines in the barometer, except for Hyperscan, suffer from this problem. That's not because of any special secret in Hyperscan, but rather, that it implements different match semantics than every other engine. I'm otherwise finding it hard to say what is "surprising" haha. Perhaps others from the outside can comment. [1]: https://github.com/BurntSushi/rebar#quadratic |
|