Skip to content

perf(vm): allocate up to 16 script arguments and 64 local variables o… - #372

Open
cobaltgit wants to merge 2 commits into
ButterscotchRunner:mainfrom
cobaltgit:stack-locals
Open

perf(vm): allocate up to 16 script arguments and 64 local variables o…#372
cobaltgit wants to merge 2 commits into
ButterscotchRunner:mainfrom
cobaltgit:stack-locals

Conversation

@cobaltgit

@cobaltgit cobaltgit commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

…n the stack before falling back to heap

takes cues from Purplesmaug's stack allocation of function args. Very early builds did this but hard-capped the local variables per code entry to 128 without any heap allocation fallback after that threshold, hamstringing compatibility.

Should help in cases where malloc slogs

…n the stack before falling back to heap

takes cues from Purplesmaug's stack allocation of function args. Very early builds did this but hard-capped the local variables per code entry to 128 without any heap allocation fallback after that threshold, hamstringing compatibility.
@cobaltgit

Copy link
Copy Markdown
Collaborator Author

Was originally done to improve performance on the PS2 target, should apply on similarly low-end targets where the interpreter bottlenecks.

@cobaltgit
cobaltgit marked this pull request as ready for review July 31, 2026 10:19
@cobaltgit

Copy link
Copy Markdown
Collaborator Author

Seems to go best with WAD 15/16 games as resolveLocalSlot will change the code locals to be heap-allocated atm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant