gh-95913: Edit & expand Optimizations in 3.11 WhatsNew by CAM-Gerlach · Pull Request #98426 · python/cpython
Part of #95913
I've added Sphinx markup and cross references to the Optimizations section of the Python What's New document, copyedited the text to fix grammar errors, read better and be slightly clearer, and sorted it by language, then builtins, then standard library (sorted by module name).
Additionally, I've added a handful of additional optimizations to common functions with documented substantial (>=15%) performance increases mentioned in the changelog (that were unrelated to Faster CPython), and consistent with the existing optimizations mentioned here and in previous verisons. These are:
- optimize int division #90564 Integer division
//20% faster - sum() several times slower on Python 3 64-bit #68264
sum()30% faster - Streamline list.append for the common case #91165
list.append15% faster / list comprehensions 20-30% faster - The speed of asyncio UDP is too slow when transferring large file #91487
asyncio.DatagramProtocol>100x faster on large files - Convert statistics sum of squares to a single pass algorithm #90415
statisticsfunctionsmean,varianceandstdev2x faster and less memory