Add mania key count grouping to song select#37243
Add mania key count grouping to song select#37243adminLAla wants to merge 4 commits intoppy:masterfrom
Conversation
| private Dictionary<GroupedBeatmapSet, HashSet<CarouselItem>> setMap = new Dictionary<GroupedBeatmapSet, HashSet<CarouselItem>>(); | ||
| private Dictionary<GroupDefinition, HashSet<CarouselItem>> groupMap = new Dictionary<GroupDefinition, HashSet<CarouselItem>>(); | ||
|
|
||
| private readonly ConcurrentDictionary<(Guid beatmapId, int converterModsSignature), int> maniaKeyCountCache = new ConcurrentDictionary<(Guid beatmapId, int converterModsSignature), int>(); |
There was a problem hiding this comment.
What is this? Why does it exist? Why is there any "caching" here at all? What's with the "mods signature", whatever it is?
There was a problem hiding this comment.
Thanks for calling this out. You are right to question it.
I originally added the cache because I first assumed the lag came from repeatedly computing key counts during regrouping. After further testing, that assumption was wrong. The actual slowdown was caused by all groups being expanded, which increased the number of visible entries and rendering work while dragging the range slider.
Since the expansion behaviour has now been fixed, this cache (and the converter-mod signature key) does not provide meaningful value and only adds complexity. I will remove the caching/signature code and keep the grouping path straightforward.
I’ll push an update shortly.
Summary
I found the key count grouping in osu!stable's mania song select very useful.
While playing osu!lazer, I noticed that this grouping option was missing, so I implemented it here.
Changes
Testing
dotnet build osu.Game.Tests -p:GenerateFullPaths=true -m -verbosity:m
dotnet test osu.Game.Tests --filter "FullyQualifiedName~BeatmapCarouselFilterGroupingTest" -v minimal
InspectCode.ps1
Equivalent static analysis steps were run manually: