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

Replace linq usage in Previous and Next on DifficultyHitObject with more direct computation #27117

Merged

Conversation

tsunyoku
Copy link
Sponsor Member

Another optimisation PR. Behaviour is the same as this is what ElementAtOrDefault does for lists, however it has extra logic to check enumerable types etc - we know what we're working with so this is quicker.

Before

image

After

image

(Benchmarks done on The Unforgiving)

@smoogipoo
Copy link
Contributor

This counts as micro-optimisation given that ElementAtOrDefault() already accounts for this, but sure.

@smoogipoo smoogipoo merged commit 2ab3187 into ppy:master Feb 11, 2024
15 of 17 checks passed
@tsunyoku tsunyoku deleted the remove-linq-from-difficulty-hit-object branch February 12, 2024 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants