classification
Title: Implement infrastructure for quickening and specializing
Type: performance Stage: resolved
Components: Versions: Python 3.11
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Mark.Shannon Nosy List: BTaskaya, Mark.Shannon, brandtbucher, pablogsal
Priority: normal Keywords: patch

Created on 2021-05-20 11:15 by Mark.Shannon, last changed 2021-06-09 17:21 by Mark.Shannon. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 26264 merged Mark.Shannon, 2021-05-20 11:39
PR 26624 merged Mark.Shannon, 2021-06-09 14:16
Messages (4)
msg394013 - (view) Author: Mark Shannon (Mark.Shannon) * (Python committer) Date: 2021-05-20 11:15
As described in PEP 659 (Specializing Adaptive Interpreter) the first part of implementing specialization is to implement the machinery to do the quickening.

Conceptually, this is fairly simple: add a new field to the code object, which points to the first instruction in the bytecode.

When quickening, we create a new array, copy the old bytecode into it, and make the new field point to it.

Without any specialization or superinstructions, this will just waste memory.
However, it will pay off soon enough as we implement superinstructions, remove the old "opcache" and add new specializations.

We expect to see worthwhile speed ups with just superinstructions, and large speedups when all the above features have been implemented.
msg395270 - (view) Author: Mark Shannon (Mark.Shannon) * (Python committer) Date: 2021-06-07 17:38
New changeset 001eb520b5757294dc455c900d94b7b153de6cdd by Mark Shannon in branch 'main':
bpo-44187: Quickening infrastructure (GH-26264)
https://github.com/python/cpython/commit/001eb520b5757294dc455c900d94b7b153de6cdd
msg395443 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2021-06-09 17:18
Is anything left in this issue?
msg395444 - (view) Author: Mark Shannon (Mark.Shannon) * (Python committer) Date: 2021-06-09 17:21
No, this is done
History
Date User Action Args
2021-06-09 17:21:18Mark.Shannonsetstatus: open -> closed
resolution: fixed
messages: + msg395444

stage: patch review -> resolved
2021-06-09 17:18:48pablogsalsetnosy: + pablogsal
messages: + msg395443
2021-06-09 14:16:35Mark.Shannonsetpull_requests: + pull_request25209
2021-06-07 17:48:35iritkatrielsetversions: + Python 3.11
2021-06-07 17:38:16Mark.Shannonsetmessages: + msg395270
2021-05-21 19:57:36brandtbuchersetnosy: + brandtbucher
2021-05-20 15:20:27BTaskayasetnosy: + BTaskaya
2021-05-20 11:39:00Mark.Shannonsetkeywords: + patch
stage: patch review
pull_requests: + pull_request24868
2021-05-20 11:15:19Mark.Shannoncreate