antoinepirlot / Satunes

Modern MP3 Player to listen your local music files on Android Lollipop 5.1.1+.
GNU General Public License v3.0
19 stars 2 forks source link

Optimization #475

Closed antoinepirlot closed 1 month ago

antoinepirlot commented 2 months ago

Optimize how musics are loaded in exo player. The goal is to reduce battery consumption.

Reduce RAM consumption by stopping loading and store artworks. only load them when needed and release when not used.

antoinepirlot commented 1 month ago

The app is slow to load now.

Also try to remove lists and use field instead. For example for Destination, give them "setting: Boolean" if it's a setting view instead of having a list to loop

antoinepirlot commented 1 month ago

When loading music in playback and playing for the first time, there's a UI freeze on playback view even if there's only one music to load 🤔 since view model.

As the artwork is loaded at the end, I guess there's a lot of recomposition that's making huge performance issues.

In Playlist in Playback, make a simple foreach instead of 3 loops.

Stop using map there and use Collection; Also, in UI use List instead of Map to show all medias as toList() is always called