ppy / osu

rhythm is just a *click* away!
https://osu.ppy.sh
MIT License
14.8k stars 2.19k forks source link

Large banana showers cause significant lag when loaded during gameplay #12659

Open Gonzalo-Bruna opened 3 years ago

Gonzalo-Bruna commented 3 years ago

Describe the bug:

Casually checking old spotlight rooms I found some people having problems with certain map, saying there is a lag spike in the same spot every single time

chat

And I tried myself using automod and the same occured at the exact same point, when the combo is exactly at 1972x The map https://osu.ppy.sh/beatmapsets/1293035#fruits/2684716

Screenshots or videos showing encountered issue:

https://user-images.githubusercontent.com/41755816/116820624-02eacc00-ab44-11eb-9704-d3c3aae40d84.mp4

osu!lazer version:

2021.502.0

Logs:

performance.log runtime.log updater.log database.log network.log

(just in case I searched for an opened issue but didn't find it)

peppy commented 3 years ago

Can you try opening the ctrl+f2 performance statistics while reproducing? This should produce more performance log output (but has to be done on windows).

Gonzalo-Bruna commented 3 years ago

this time the spike was shorter but it's still there

https://user-images.githubusercontent.com/41755816/116821038-21ea5d80-ab46-11eb-8be7-3caf284120b9.mp4

performance-draw.log performance-input.log performance-update.log runtime.log updater.log database.log network.log performance.log performance-audio.log

ekrctb commented 3 years ago

The lag spike is due to the loading of 257 bananas. Currently, all nested hit objects are loaded at once synchronously when the parent hit object became alive. This issue should apply to other rulesets as well (like a slider with many slider tick points).

peppy commented 3 years ago

Did some quick profiling and traced a lot of the overhead to BeginAbsoluteSequence, which is something we already knew was pretty slow.

20210503 200835 (JetBrains Rider)