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

Improve performance of Yacht Dice #3

Merged
merged 4 commits into from
Jun 7, 2024
Merged

Conversation

NewSoupVi
Copy link

@NewSoupVi NewSoupVi commented Jun 7, 2024

This can be improved further I'm sure. This is the maximally naive & pluggable & 5 minute solution

Working around the state_is_list thing was quite annoying especially in this respect

@NewSoupVi
Copy link
Author

I also confirmed that the output is the exact same for the same seed.

@NewSoupVi
Copy link
Author

Oh, just for some benchmarks:

Singleplayer is not improved by a ton, but still a bit:
1.3s -> 1.0s

5 player multiworld is improved a ton:
21s -> 9s

def collect(self, state: CollectionState, item: Item) -> bool:
change = super().collect(state, item)
if change and item.advancement:
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The more specific you can be here about "which items does the state actually need to be recalculated on", the faster this will be

Copy link
Author

@NewSoupVi NewSoupVi Jun 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...except for the exact way I did it, which is just slower lol, you already only get advancements in this function, so checking item.advancement is slower, my b

@spinerak spinerak merged commit 7fa48ea into spinerak:main Jun 7, 2024
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.

2 participants