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.

Author brandtbucher
Recipients Mark.Shannon, brandtbucher
Date 2022-03-31.01:12:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <[email protected]>
In-reply-to
Content
Rather than maintaining the offset of the "last instruction" (`f_lasti`), interpreter frames should instead just maintain a pointer to the true next instruction. This has several benefits, most notably reducing the register pressure associated with loading first_instr on every instruction and call in the main interpreter loop:

When entering a frame:

- Before: `next_instr = first_instr + frame->f_lasti + 1;`
- After:  `next_instr = frame->next_instr;`

When starting a new instruction:

- Before: `frame->next_instr = next_instr++ - first_instr;`
- After:  `frame->next_instr = ++next_instr;`

Benchmarks suggest that this overhead is surprisingly significant (something like 2%).
History
Date User Action Args
2022-03-31 01:12:26brandtbuchersetrecipients: + brandtbucher, Mark.Shannon
2022-03-31 01:12:26brandtbuchersetmessageid: <[email protected]>
2022-03-31 01:12:26brandtbucherlinkissue47177 messages
2022-03-31 01:12:26brandtbuchercreate