Move stackref buffer to per-eval loop to reduce interp stack usage
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 35.9k
- PR merge metrics
- PR metrics pending
Description
Feature or enhancement
Proposal:
The interpreter main loop's stack usage is huge. We should try to reduce it a little. Currently, the stackref buffer takes up 10 words on 64-bit machines. We could lessen that by moving it to the heap (thread state).
This might mean slightly less perf due to worse locality and one memory indirection. So let's benchmark this to be sure.
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Linked PRs
- gh-138116
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the interpreter main loop and locate the stackref buffer and thread state referenced in the proposal. Benchmark the current and proposed arrangements, including stack usage, locality or indirection costs, and performance. Done means the stackref buffer is moved as proposed only if the measurements support the change; gh-138116 indicates work is already underway.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100