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.
Considering the upcoming pp changes, the
OsuObject
struct is currently 88 bytes large. 56 of those come from theOsuObjectKind
enum whose variants areCircle
(1 byte),Slider
(56 bytes), andSpinner
(8 byte). Boxing the slider would shrinkOsuObjectKind
down to 16 bytes andOsuObject
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.