Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Re-order by language (impact), builtins (impact), stdlib (a->z)
  • Loading branch information
CAM-Gerlach committed Oct 19, 2022
commit 3d5f4c4260e0e90acf9279ba8d573eaabd20308f
24 changes: 12 additions & 12 deletions Doc/whatsnew/3.11.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1128,36 +1128,36 @@ fcntl
Optimizations
=============

* "Zero-cost" exceptions are implemented, eliminating the cost
Comment thread
CAM-Gerlach marked this conversation as resolved.
Outdated
of :keyword:`try` statements when no exception is raised.
(Contributed by Mark Shannon in :issue:`40222`.)

* The compiler now optimizes simple
:ref:`printf-style % formatting <old-string-formatting>` on string literals
containing only the format codes ``%s``, ``%r`` and ``%a`` and makes it as
fast as a corresponding :term:`f-string` expression.
(Contributed by Serhiy Storchaka in :issue:`28307`.)

* "Zero-cost" exceptions are implemented, eliminating the cost
of :keyword:`try` statements when no exception is raised.
(Contributed by Mark Shannon in :issue:`40222`.)

* Pure ASCII strings are now normalized in constant time by
:func:`unicodedata.normalize`.
(Contributed by Dong-hee Na in :issue:`44987`.)

* :mod:`math` functions :func:`~math.comb` and :func:`~math.perm` are now
≈10 times faster for large arguments (with a larger speedup for larger *k*).
(Contributed by Serhiy Storchaka in :issue:`37295`.)

* Dictionaries don't store hash values when all keys are Unicode objects,
decreasing :class:`dict` size.
For example, ``sys.getsizeof(dict.fromkeys("abcdefg"))``
is reduced from 352 bytes to 272 bytes (23% smaller) on 64-bit platforms.
(Contributed by Inada Naoki in :issue:`46845`.)

* :mod:`math` functions :func:`~math.comb` and :func:`~math.perm` are now
≈10 times faster for large arguments (with a larger speedup for larger *k*).
(Contributed by Serhiy Storchaka in :issue:`37295`.)

* :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.
Comment thread
CAM-Gerlach marked this conversation as resolved.
Outdated

* :func:`unicodedata.normalize`
now normalizes pure-ASCII strings in constant time.
(Contributed by Dong-hee Na in :issue:`44987`.)


.. _whatsnew311-faster-cpython:

Expand Down