MaxOhn / rosu-pp

PP and star calculation for all osu! gamemodes
MIT License
79 stars 40 forks source link

Consider boxing `OsuSlider` #42

Open MaxOhn opened 4 days ago

MaxOhn commented 4 days ago

Considering the upcoming pp changes, the OsuObject struct is currently 88 bytes large. 56 of those come from the OsuObjectKind enum whose variants are Circle (1 byte), Slider (56 bytes), and Spinner (8 byte). Boxing the slider would shrink OsuObjectKind down to 16 bytes and OsuObject to 48.

In the end, this reduces the allocation size when collecting all objects by about 45% at the cost of a small allocation for each slider. Unsure about performance implications, will require some benchmarking.

Either way, this change is technically breaking and should therefore wait until the next major release.