gh-91404: Use computed gotos and reduce indirection in re (#91495)

This commit is contained in:
Brandt Bucher 2022-04-15 09:26:44 -07:00 committed by GitHub
parent d104f4d21f
commit 1b34b5687b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 483 additions and 348 deletions

View file

@ -520,6 +520,12 @@ Optimizations
becomes 272 bytes from 352 bytes on 64bit platform.
(Contributed by Inada Naoki in :issue:`46845`.)
* :mod:`re`'s regular expression matching engine has been partially refactored,
and now uses computed gotos (or "threaded code") on supported platforms. As a
result, Python 3.11 executes the `pyperformance regular expression benchmarks
<https://pyperformance.readthedocs.io/benchmarks.html#regex-dna>`_ up to 10%
faster than Python 3.10.
Faster CPython
==============