ErisApps / HitScoreVisualizer

Beat Saber plugin that colors the scores that pop up when you hit notes
MIT License
71 stars 13 forks source link

HSV optimization pass #13

Open ErisApps opened 2 years ago

ErisApps commented 2 years ago

HSV has grown organically, adding new features during most updates, while trying to maintain backwards-compatibility as much as possible. However, this has lead to some degree over performance overhad over time, especially during gameplay.

There's a bunch of changes can be done to improve performance though. We could separate the data model classes for user config. Historically, the config model for the file on disk and the internal config has been the exact same. Initially, this was fine as configs (and thus the mod) were fairly limited in capabilities. This is nowadays a bit of a restriction though, which limits some the optimizations that can be done.

The config models for the file on disk and in-memory being separated allows us to optimize the userconfig before heading into a song, this would include, but not limited to, memory allocation improvements (currently, there's A LOT of memory allocations regarding color conversion for example), as well as a possibly more streamlined process for config migration and validation.

It's probably also feasible to do other minor improvements, but this would require further investment into analysis and profiling.