Figure out cause of weird ThreadPoolServiceThread tasks
Closed this issue · 2 comments
I've noticed the app sometimes continuously consuming around 5% CPU after I've been using it for a while. This happens even when the music is paused and the tab is backgrounded. Dev Tools doesn't point at any JS code, but it looks like there are two ThreadPoolServiceThread
tasks that are running every 10-12 ms. They complete very quickly, but presumably they're still causing task switches and draining the battery:
This doesn't happen as soon as I open the app, or even after I play and then pause, but I usually see it after playing and pausing a few times. It appears to happen both on a Chromebook and a desktop Linux system. I added logging to all the timeouts and timeupdate
calls, but they don't appear to be firing while this is happening.
https://chromium.googlesource.com/chromium/src/+/refs/heads/main/base/task/thread_pool/service_thread.h is the ThreadPoolServiceThread
implementation, but it doesn't really help me figure out what this is. I guess it's used for I/O.
I tried to repro this on a simple page that just has an <audio>
element, but I haven't been successful yet.