Skip to content

Move stackref buffer to thread state to reduce interp stack usage #138115

@Fidget-Spinner

Description

@Fidget-Spinner

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions