Repository navigation
Clear queue using range removals instead of per-item loop - #230
DarkPhoenix42 wants to merge 1 commit into
Conversation
Clearing the playback queue when holding a large amount of songs (~450) took a few seconds and noticeably froze the UI. This was due to the clearing being done using a per-item removal loop which causes a lot of redundant IPC calls along with timeline recomputations in the player engine. This change replaces the per-item removal loop with atmost two removeMediaItems() range calls, reducing the queue clearing time to a few milliseconds and eliminating the UI freeze.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
[Medium impact] This change appears safe to merge.
|
|
Will look into these prs as soon as possible, it's kinda busy since I got into a full time job, sorry about that. |
What changed
Clearing the playback queue when holding a large amount of songs (~450) took a few seconds and noticeably froze the UI. This was due to the clearing being done using a per-item removal loop which causes a lot of redundant IPC calls along with timeline recomputations in the player engine.
This change replaces the per-item removal loop with atmost two
removeMediaItems()range calls, reducing the queue clearing time to a few milliseconds and eliminating the UI freeze.Tests
./gradlew :app:compileDebugKotlin :app:lintDebug :app:testDebugUnitTestpasses