ARMeilleure: replace else-ifs with switch statements #124
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "switch-st"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR replaces several if/else if/else statements with switch statements across ARMeilleure. This should result in a very minor performance increase in some CPU/PPTC-related tasks.
I've tested several games with no issues, but further testing is welcome.
Download the artifacts for this pull request:
GUI-less (SDL2)
Only for Developers
Great job! I’ll add some tests to check if there’s been any regression.
Setup
Ryzen 5 5600
32GB - 3200Mhz
RTX 4060ti - Driver 566.03
Pokémon Legends: Arceus(1.1.1.)
MAIN(1.2.72)
https://github.com/user-attachments/assets/bf00bd1e-a1f4-4b41-9bc7-7e9ab7f20f52
PR-124
https://github.com/user-attachments/assets/044f7264-5c03-4030-b825-523e3542dd28
I will add more games later.
MAINTAINER EDIT: These videos are h.265 encoded and seemingly only viewable in Chromium-based browsers, or via downloading & watching with a program that can handle h.265.
EDIT 2: I uploaded it again with h.264
It would be great to see this merged, but we're still waiting on the sparse jit pr, which hasn't yet been tested to Greem's satisfaction, I imagine this will have to be tested just as thoroughly. I will do another reddit testing thread once the sparse jit has been merged.
Very strange, I used OBS Studio to record and Handbrake to convert it to h.265 and reduce the file size.
Tested Super Smash Bro's & Echos of Wisdom on M4 Max Macbook Pro. Both seemed to run well
Have you profiled this to check that the JIT is not already performing any relevant optimizations or is this just something that is suggested by IDE? As most of these contain very few potential branches, I'm unsure if the runtime would not simply lower this into identical IL.
I'm pretty sure these changes are mostly redundant. the .NET compiler is very smart about converting
if
s that would be more performant asswitch
es intoswitch
es, and also the other way around; needless switches that would be faster as if
s.as a result I'm going to reject this.
Pull request closed