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

Implement better batching #24

Merged
merged 5 commits into from
May 25, 2024
Merged

Implement better batching #24

merged 5 commits into from
May 25, 2024

Conversation

Syriiin
Copy link
Owner

@Syriiin Syriiin commented May 25, 2024

Why?

Batch calculations are very naive at the moment.
It effectively is the same process as doing single calculations, but using a single HTTP request.
In the case where there are many hits to the cache/recalculations of the same beatmap/mod, we are wasting a lot of effort.
This PR implement smarter batching by grouping scores by beatmap/mods and processing them in groups to share difficulty calculations.

Changes

  • Update a bunch of deps
  • Implement better batching
  • Add test to ensure better batching doesn't break result ordering

Breaking changes

  • Update CalculatorService.CalculateDifficultyAttributes method signature
- protected abstract (object, string) CalculateDifficultyAttributes(TScore score);
+ protected abstract (object, string) CalculateDifficultyAttributes(string beatmapId, int mods);

@Syriiin Syriiin changed the title Better batching Implement better batching May 25, 2024
@Syriiin Syriiin force-pushed the better-batching branch from a7eb524 to aaf7059 Compare May 25, 2024 08:08
@Syriiin Syriiin merged commit ee6597b into master May 25, 2024
3 checks passed
@Syriiin Syriiin deleted the better-batching branch May 25, 2024 08:15
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.

1 participant