Skip to content

Commit 5e67f8b

Browse files
committed
Add cross references and refine reST syntax in specialization table
1 parent a7493eb commit 5e67f8b

File tree

1 file changed

+21
-20
lines changed

1 file changed

+21
-20
lines changed

Doc/whatsnew/3.11.rst

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1298,32 +1298,32 @@ Bucher, with additional help from Irit Katriel and Dennis Sweeney.)
12981298
| Operation | Form | Specialization | Operation speedup | Contributor(s) |
12991299
| | | | (up to) | |
13001300
+===============+====================+=======================================================+===================+===================+
1301-
| Binary | ``x+x; x*x; x-x;`` | Binary add, multiply and subtract for common types | 10% | Mark Shannon, |
1302-
| operations | | such as ``int``, ``float``, and ``str`` take custom | | Dong-hee Na, |
1303-
| | | fast paths for their underlying types. | | Brandt Bucher, |
1301+
| Binary | ``x + x`` | Binary add, multiply and subtract for common types | 10% | Mark Shannon, |
1302+
| operations | | such as :class:`int`, :class:`float` and :class:`str` | | Dong-hee Na, |
1303+
| | ``x - x`` | take custom fast paths for their underlying types. | | Brandt Bucher, |
13041304
| | | | | Dennis Sweeney |
1305+
| | ``x * x`` | | | |
13051306
+---------------+--------------------+-------------------------------------------------------+-------------------+-------------------+
1306-
| Subscript | ``a[i]`` | Subscripting container types such as ``list``, | 10-25% | Irit Katriel, |
1307-
| | | ``tuple`` and ``dict`` directly index the underlying | | Mark Shannon |
1308-
| | | data structures. | | |
1307+
| Subscript | ``a[i]`` | Subscripting container types such as :class:`list`, | 10-25% | Irit Katriel, |
1308+
| | | :class:`tuple` and :class:`dict` directly index | | Mark Shannon |
1309+
| | | the underlying data structures. | | |
13091310
| | | | | |
1310-
| | | Subscripting custom ``__getitem__`` | | |
1311+
| | | Subscripting custom :meth:`~object.__getitem__` | | |
13111312
| | | is also inlined similar to :ref:`inline-calls`. | | |
13121313
+---------------+--------------------+-------------------------------------------------------+-------------------+-------------------+
13131314
| Store | ``a[i] = z`` | Similar to subscripting specialization above. | 10-25% | Dennis Sweeney |
13141315
| subscript | | | | |
13151316
+---------------+--------------------+-------------------------------------------------------+-------------------+-------------------+
13161317
| Calls | ``f(arg)`` | Calls to common builtin (C) functions and types such | 20% | Mark Shannon, |
1317-
| | ``C(arg)`` | as ``len`` and ``str`` directly call their underlying | | Ken Jin |
1318-
| | | C version. This avoids going through the internal | | |
1319-
| | | calling convention. | | |
1320-
| | | | | |
1318+
| | | as :func:`len` and :class:`str` directly call their | | Ken Jin |
1319+
| | ``C(arg)`` | underlying C version. This avoids going through the | | |
1320+
| | | internal calling convention. | | |
13211321
+---------------+--------------------+-------------------------------------------------------+-------------------+-------------------+
1322-
| Load | ``print`` | The object's index in the globals/builtins namespace | [1]_ | Mark Shannon |
1323-
| global | ``len`` | is cached. Loading globals and builtins require | | |
1324-
| variable | | zero namespace lookups. | | |
1322+
| Load | ``print()`` | The object's index in the globals/builtins namespace | [#load-global]_ | Mark Shannon |
1323+
| global | | is cached. Loading globals and builtins require | | |
1324+
| variable | ``len()`` | zero namespace lookups. | | |
13251325
+---------------+--------------------+-------------------------------------------------------+-------------------+-------------------+
1326-
| Load | ``o.attr`` | Similar to loading global variables. The attribute's | [2]_ | Mark Shannon |
1326+
| Load | ``o.attr`` | Similar to loading global variables. The attribute's | [#load-attr]_ | Mark Shannon |
13271327
| attribute | | index inside the class/object's namespace is cached. | | |
13281328
| | | In most cases, attribute loading will require zero | | |
13291329
| | | namespace lookups. | | |
@@ -1335,14 +1335,15 @@ Bucher, with additional help from Irit Katriel and Dennis Sweeney.)
13351335
| Store | ``o.attr = z`` | Similar to load attribute optimization. | 2% | Mark Shannon |
13361336
| attribute | | | in pyperformance | |
13371337
+---------------+--------------------+-------------------------------------------------------+-------------------+-------------------+
1338-
| Unpack | ``*seq`` | Specialized for common containers such as ``list`` | 8% | Brandt Bucher |
1339-
| Sequence | | and ``tuple``. Avoids internal calling convention. | | |
1338+
| Unpack | ``*seq`` | Specialized for common containers such as | 8% | Brandt Bucher |
1339+
| Sequence | | :class:`list` and :class:`tuple`. | | |
1340+
| | | Avoids internal calling convention. | | |
13401341
+---------------+--------------------+-------------------------------------------------------+-------------------+-------------------+
13411342

1342-
.. [1] A similar optimization already existed since Python 3.8. 3.11
1343-
specializes for more forms and reduces some overhead.
1343+
.. [#load-global] A similar optimization already existed since Python 3.8.
1344+
3.11 specializes for more forms and reduces some overhead.
13441345
1345-
.. [2] A similar optimization already existed since Python 3.10.
1346+
.. [#load-attr] A similar optimization already existed since Python 3.10.
13461347
3.11 specializes for more forms. Furthermore, all attribute loads should
13471348
be sped up by :issue:`45947`.
13481349

0 commit comments

Comments
 (0)