Improve song select search performance #25679
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Just a quick optimisation pass. Anything further will require more consideration, as the overhead is coming from the raw
IndexTo
operation, and to a lesser extentCarouselBeatmap.checkMatch()
and other methods with nothing too simple to optimise out:Initial filter is the full load of song select (includes sort). Subsequent are filtering on non-matching strings (ie. "aaaaaaa").
master
:[runtime] 2023-12-05 05:23:02 [verbose]: Filter took 8,785.0 ms
[runtime] 2023-12-05 05:23:39 [verbose]: Filter took 9,147.0 ms
[runtime] 2023-12-05 05:23:50 [verbose]: Filter took 9,159.0 ms
[runtime] 2023-12-05 05:24:00 [verbose]: Filter took 9,254.0 ms
[runtime] 2023-12-05 05:24:16 [verbose]: Filter took 9,474.0 ms
after 7fda38d:
[runtime] 2023-12-05 05:20:36 [verbose]: Filter took 8,739.0 ms
[runtime] 2023-12-05 05:21:40 [verbose]: Filter took 6,354.0 ms
[runtime] 2023-12-05 05:21:47 [verbose]: Filter took 6,471.0 ms
[runtime] 2023-12-05 05:21:53 [verbose]: Filter took 6,437.0 ms
[runtime] 2023-12-05 05:22:02 [verbose]: Filter took 6,753.0 ms
after 27e778a:
[runtime] 2023-12-05 05:18:30 [verbose]: Filter took 8,990.0 ms
[runtime] 2023-12-05 05:19:15 [verbose]: Filter took 1,266.0 ms
[runtime] 2023-12-05 05:19:17 [verbose]: Filter took 1,213.0 ms
[runtime] 2023-12-05 05:19:19 [verbose]: Filter took 1,179.0 ms
[runtime] 2023-12-05 05:19:21 [verbose]: Filter took 1,166.0 ms
after 36eb338:
[runtime] 2023-12-05 05:54:19 [verbose]: Filter took 8,789.0 ms
[runtime] 2023-12-05 05:54:41 [verbose]: Filter took 1,232.0 ms
[runtime] 2023-12-05 05:54:43 [verbose]: Filter took 1,061.0 ms
[runtime] 2023-12-05 05:54:44 [verbose]: Filter took 1,039.0 ms
[runtime] 2023-12-05 05:54:46 [verbose]: Filter took 1,032.0 ms
Testing done using:
Improves #11571 but probably doesn't close yet (would want things to be async still).
Reduces time taken to search beatmaps at song select by 88%.