Re: regex is much slower in pypy than cpython
Michał Górny <[email protected]> Wed, 03 Sep 2025 06:15:40 +0200
| Newsgroups | gmane.comp.python.pypy |
|---|---|
| Organization | Gentoo |
| Message-ID | <[email protected]> |
--===============5082396755538473672== Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-6F7GmOq+wVQ8rsAdJ877" --=-6F7GmOq+wVQ8rsAdJ877 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 2025-09-03 at 10:16 +0800, Li Li via pypy-dev wrote: > I want to use pypy to speed up my application, it's fast for standard > library such as dict/list. I need to use a third party library regex( > https://pypi.org/project/regex/). pypy is much slower with this library. > for full codes, see https://github.com/mrabarnett/mrab-regex/issues/586 >=20 The regex library doesn't work correctly under PyPy. The author is using internal CPython implementation details that don't match PyPy, meaning it's not only slow but also incorrect. We have reported this before, suggesting how to achieve the same thing using the correct, public API, but the author was opposed to it. My suggestion would be not to use that library at all. Some of its functionality is provided on top of stdlib by "backrefs" package, maybe that'll help. --=20 Best regards, Micha=C5=82 G=C3=B3rny --=-6F7GmOq+wVQ8rsAdJ877 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- iQFGBAABCgAwFiEEx2qEUJQJjSjMiybFY5ra4jKeJA4FAmi3wOwSHG1nb3JueUBn ZW50b28ub3JnAAoJEGOa2uIyniQOErkIAJ2dcmwHbr2UQHokFmUKTL6WGlphYX2z VQjk/Q9WC/blo3fyHq7Z1u/Xaj6ZbR+Rgd2VtRjURRwW78Y+leGEWtUDBz3rCegm RC3x9XWqJy/iDjslQocxvnaDjNnFpWYpzgAYiag9J6Zpkb89K3DVrympvq3py8h/ /tXqjji0WwCaIWTnoqm8eZ2Wbxo6I/q972dglN0OEB2QvKcSQxdf12+KTaBWL86A KJT/mdEwXjbk7ioiuEIs4s6yT7r9sJtGxTmpmlL/P7z1A8VVvlRKFhwPzTyeja9p KF2EMt+EW2m+dVSC4lSl+WhQYNxxifHJmRFZ2ig1GWjmEje3LXdpEUY= =Ghti -----END PGP SIGNATURE----- --=-6F7GmOq+wVQ8rsAdJ877-- --===============5082396755538473672== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ pypy-dev mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3//lists/pypy-dev.python.org Member address: [email protected] --===============5082396755538473672==--