MaxOhn / rosu-v2

A rust wrapper for the osu!api v2
MIT License
24 stars 9 forks source link

perf!: box big structs #11

Closed MaxOhn closed 11 months ago

MaxOhn commented 11 months ago

Boxes most fields of (optional) type User(Extended), Beatmap(Extended), and Beatmapset(Extended). This causes more allocations but reduces struct sizes significantly and thus reduce the allocation sizes.

___Without boxes:___
Score: 2840
Beatmap: 512
BeatmapExtended: 1584
Beatmapset: 408
BeatmapsetExtended: 1376

___With boxes:___
Score: 168
Beatmap: 112
BeatmapExtended: 216
Beatmapset: 408
BeatmapsetExtended: 680