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

lufia2ac: improve performance of access rules #2456

Merged
merged 1 commit into from
Nov 15, 2023

Conversation

el-u
Copy link
Collaborator

@el-u el-u commented Nov 13, 2023

What is this fixing or adding?

Modifies various access rules in the lufia2ac world with the aim of making them evaluate quicker.
Instead of having to determine the reachability of another location, they now only have to count items in state, which is faster.
(Also made it reuse the identical lambda for multiple locations, which might save a smidgen of memory.)

"But el_, why didn't you rewrite everything using regions?"
Not sure if much faster, the current benchmark PR is not entirely suitable to compare that. Anyway, the location access rules should at least be reasonably fast now at least.
Also, introducing more regions would probably have made the world code slightly more involved, while I'd argue that this PR instead makes the code more readable.
So I'll leave it like that for now and we can see whether further changes might be worthwhile in the future.

How was this tested?

#2433

Before:
image
After:
image

@ThePhar ThePhar added the is: refactor/cleanup Improvements to code/output readability or organizization. label Nov 13, 2023
@Berserker66 Berserker66 merged commit 6c1ae77 into ArchipelagoMW:main Nov 15, 2023
12 checks passed
@el-u el-u deleted the lufia2ac-performance branch November 15, 2023 17:29
Jouramie pushed a commit to Jouramie/Archipelago that referenced this pull request Feb 28, 2024
Modifies various access rules in the lufia2ac world with the aim of making them evaluate quicker.
Instead of having to determine the reachability of another location, they now only have to count items in state, which is faster.
(Also made it reuse the identical lambda for multiple locations, which might save a smidgen of memory.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
is: refactor/cleanup Improvements to code/output readability or organizization.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants