This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Redesign PyCodeObject.co_extras to use a single memory block, instead of two
Type: performance Stage: resolved
Components: Interpreter Core Versions: Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: dino.viehland, serhiy.storchaka, vstinner, yselivanov
Priority: normal Keywords:

Created on 2017-06-28 00:10 by vstinner, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 2555 merged serhiy.storchaka, 2017-07-04 04:00
Messages (7)
msg297077 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-06-28 00:10
Currently, _PyCode_SetExtra() uses two memory block for code extras. Using a different structure, it would be possible to use a single memory block: less memory fragmentation, better CPU cache usage, less indirections, etc.

It matters since the long term plan for co_extras is to implement of kind-of JIT compiler insider CPython: see bpo-28158.
msg297624 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-07-04 04:01
Since nobody has provided a patch I have made it myself.
msg297648 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-07-04 12:06
New changeset 378ebb6578b9d709f38b888d23874c0b18125249 by Victor Stinner (Serhiy Storchaka) in branch 'master':
bpo-30789: Use a single memory block for co_extra. (#2555)
https://github.com/python/cpython/commit/378ebb6578b9d709f38b888d23874c0b18125249
msg297745 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-07-05 13:44
New changeset 8207c17486baece8ed0ac42d9f8d69ecec4ba7e4 by Victor Stinner in branch 'master':
Revert "bpo-30822: Fix testing of datetime module." (#2588)
https://github.com/python/cpython/commit/8207c17486baece8ed0ac42d9f8d69ecec4ba7e4
msg297764 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-07-05 15:01
How is this related to datetime module? I hope you didn't reverted too much?
msg297769 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-07-05 15:59
> How is this related to datetime module? I hope you didn't reverted too much?

I'm sorry for the spam. It was the first time that I really used the
[Revert] button: even if the revert change is correct, the *commit
message* is completely wrong :-/
https://mail.python.org/pipermail/python-committers/2017-July/004674.html
msg297770 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-07-05 15:59
I'm sorry for the spam. It was the first time that I really used the
[Revert] button: even if the revert change is correct, the *commit
message* is completely wrong :-/
https://mail.python.org/pipermail/python-committers/2017-July/004674.html
History
Date User Action Args
2022-04-11 14:58:48adminsetgithub: 74972
2017-07-05 15:59:12vstinnersetmessages: + msg297770
2017-07-05 15:59:10vstinnersetmessages: + msg297769
2017-07-05 15:01:24serhiy.storchakasetmessages: + msg297764
2017-07-05 13:44:56vstinnersetmessages: + msg297745
2017-07-04 12:18:48serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2017-07-04 12:06:18vstinnersetmessages: + msg297648
2017-07-04 04:01:06serhiy.storchakasetmessages: + msg297624
stage: needs patch -> patch review
2017-07-04 04:00:00serhiy.storchakasetpull_requests: + pull_request2624
2017-06-28 04:08:47serhiy.storchakasetnosy: + serhiy.storchaka

stage: needs patch
2017-06-28 00:11:55vstinnersetnosy: + dino.viehland, yselivanov
2017-06-28 00:10:41vstinnercreate