Skip to content

Commit 5b34b2c

Browse files
committed
Update wording of resolvers guide
Given ua-parser/uap-rust#29 and ua-parser/uap-rust#31, the wording of the comparison needs to be updated to account for: - The `regex` memory use being much improved. - The `regex` runtime on devices being slightly improved, with the Python interface to `re2` not supporting custom atom lengths. Closes #264
1 parent 911b7a3 commit 5b34b2c

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

doc/guides.rst

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ Builtin Resolvers
153153
* - ``regex``
154154
- great
155155
- good
156-
- bad
156+
- fine
157157
- great
158158
* - ``re2``
159159
- good
@@ -182,12 +182,11 @@ it:
182182
interpreters and platforms supported by pyo3 (currently: cpython,
183183
pypy, and graalpy, on linux, macos and linux, intel and arm). It is
184184
also built as a cpython abi3 wheel and should thus suffer from no
185-
compatibility issues with new release.
185+
compatibility issues with new releases of cpython at least.
186186
- Built entirely out of safe rust code, its safety risks are entirely
187187
in ``regex`` and ``pyo3``.
188-
- Its biggest drawback is that it is a lot more memory intensive than
189-
the other resolvers, because ``regex`` tends to trade memory for
190-
speed (~155MB high water mark on a real-world dataset).
188+
- Uses somewhat more memory than the other resolvers (~85MB high water
189+
mark on a real-world dataset).
191190

192191
If available, it is the default resolver, without a cache.
193192

@@ -198,7 +197,7 @@ The ``re2`` resolver is built atop the widely used `google-re2
198197
<https://github.com/google/re2>`_ via its built-in Python bindings.
199198
It:
200199

201-
- Is extremely fast, though around 80% slower than ``regex`` on
200+
- Is quite fast, though only about half the speed of ``regex`` on
202201
real-world data.
203202
- Is only compatible with CPython, and uses pure API wheels, so needs
204203
a different release for each cpython version, for each OS, for each
@@ -210,6 +209,9 @@ It:
210209

211210
If available, it is the second-preferred resolver, without a cache.
212211

212+
At the end of the day, it is really only useful if the codebase
213+
already uses ``re2``.
214+
213215
``basic``
214216
---------
215217

0 commit comments

Comments
 (0)