From 08c1951084f93496f200b9114e2e6050e1b7e680 Mon Sep 17 00:00:00 2001 From: meooow25 Date: Sat, 2 Mar 2024 19:36:15 +0530 Subject: [PATCH] Link to pcre Unicode issue + formatting --- bench/README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/bench/README.md b/bench/README.md index 78fb228..c39cf57 100644 --- a/bench/README.md +++ b/bench/README.md @@ -10,18 +10,19 @@ A comparison of some Haskell regex libraries: | | `parser-regex` | `regex-applicative` | `regex-tdfa` | `regex-pcre-builtin` | | --- | --- | --- | --- | --- | | Regex construction | Combinators | Combinators | Pattern | Pattern | -| Unicode aware | Yes | Yes | Yes | No | +| Unicode aware | Yes | Yes | Yes | No[1] | | Parsing features | Yes | Yes | Submatch only | Submatch only | | Extensions | No | No | No | Yes (lookahead, backreferences, etc.) | | Text matching speed
(`English text 1,2`) | Baseline | Slower | Faster | Very fast | -| Text replace speed
(`English replace all`) | Baseline | Slower | Slower [1] | Comparable [2] | +| Text replace speed
(`English replace all`) | Baseline | Slower | Slower[2] | Comparable[3] | | Parsing speed
(`CaseFolding.txt`,`URI`) | Baseline | Slower | Comparable | Very fast | | Regex compilation complexity | $O(m)$ | Undocumented, $O(m^2)$ judging by source code | Undocumented | Undocumented | -| Parsing complexity | $O(mn \log m)$ | Documented "roughly linear complexity", $O(m^2 n \log m)$ judging by source code | $O(n)$ claimed [3] | Undocumented, $O(2^n)$ seen experimentally | +| Parsing complexity | $O(mn \log m)$ | Documented "roughly linear complexity", $O(m^2 n \log m)$ judging by source code | $O(n)$ claimed [4] | Undocumented, $O(2^n)$ seen experimentally | -1 Replacement requires a separate library, [`regex`](https://hackage.haskell.org/package/regex) -2 Replacement requires a separate library, [`regex-with-pcre`](https://hackage.haskell.org/package/regex-with-pcre) -3 I do not know if this is accurate, since $O(n)$ is only possible by spending +1 [`regex-pcre-builtin#3`](https://github.com/audreyt/regex-pcre-builtin/issues/3) +2 Replacement requires a separate library, [`regex`](https://hackage.haskell.org/package/regex) +3 Replacement requires a separate library, [`regex-with-pcre`](https://hackage.haskell.org/package/regex-with-pcre) +4 I do not know if this is accurate, since $O(n)$ is only possible by spending $O(2^m)$ on compilation, which libraries usually consider too great a cost. `regex-tdfa` mentions that it is based on the [`tre`](https://github.com/laurikari/tre/) library, which claims $O(m^2 n)$ time. This could be true of `regex-tdfa` also.