xyonico / BeatSaberSongLoader

A plugin for adding custom songs into Beat Saber
MIT License
238 stars 38 forks source link

Audio files are loaded too early #24

Closed ErenBYilmaz closed 6 years ago

ErenBYilmaz commented 6 years ago

The realease notes for version 4 state

Significantly improved loading time by only loading audio files when they are needed.

Nevertheless, as soon as Beat Saber is started it takes a long time loading all the custom songs into the RAM (over 3000 songs for me). I only have 10GB of RAM and it is full quite fast. The threading feature also does not help much since it pauses loading the songs if try start one of the original songs.

xyonico commented 6 years ago

How long would you say it takes for all the songs to load? I think it's unlikely this issue is that audio is getting loaded too early. All the cover images are still loaded at start, which can be up to 1 GB of memory with over 2500 songs.

When the songs are loaded, could you check Task Manager to see just how much memory is being used by Beat Saber? If audio was truly loading too early, it would easily go over 10 GB with over 3000 songs.

I can't continue loading songs if the game loads a new scene, like it does when starting a song. If it did, the game would crash.

ErenBYilmaz commented 6 years ago

How long would you say it takes for all the songs to load?

I just ran a few tests, the loading is 4:16 when first launching Beat Saber and interestingly only 0:58 when closing the game and immediately starting it up again.

I think it's unlikely this issue is that audio is getting loaded too early. All the cover images are still loaded at start, which can be up to 1 GB of memory with over 2500 songs.

When the songs are loaded, could you check Task Manager to see just how much memory is being used by Beat Saber? If audio was truly loading too early, it would easily go over 10 GB with over 3000 songs.

My mistake, somehow I thought the RAM usage was way higher, The whole game only uses about 4 GB when fully loaded which is acceptable for me.

Maybe it is just too many songs, for my potato PC :D

ErenBYilmaz commented 6 years ago

All the cover images are still loaded at start, which can be up to 1 GB of memory with over 2500 songs.

I managed to reduce RAM usage to 1.5 GB by deleting all the cover images and removing the corresponding entries from json.ini files and it seems to also reduce loading time. Thx for the hint.

Of course I would be thankful for any further optimizations, but for now it works well enough.