Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexRefWithString peephole opt #2132

Merged
merged 2 commits into from
Dec 11, 2024
Merged

Conversation

ike709
Copy link
Collaborator

@ike709 ike709 commented Dec 10, 2024

PushReferenceValue -> PushString -> DereferenceIndex is a pretty common pattern in TG. This combines them into one new IndexRefWithString opcode.

The new opcode occurs 6,170 times in TG. This means a pretty decent reduction in pushing/popping the stack.

I joined TG and confirmed it didn't seem to explode, and I could still run around.

@boring-cyborg boring-cyborg bot added Compiler Involves the OpenDream compiler Runtime Involves the OpenDream server/runtime labels Dec 10, 2024
DMCompiler/Optimizer/PeepholeOptimizations.cs Outdated Show resolved Hide resolved
@wixoaGit wixoaGit enabled auto-merge December 11, 2024 16:12
@wixoaGit wixoaGit merged commit c7c89ae into OpenDreamProject:master Dec 11, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compiler Involves the OpenDream compiler Runtime Involves the OpenDream server/runtime size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants