Consider only profiling when events are running




Gecko Profiler
9 months ago
9 months ago


(Reporter: billm, Unassigned)


Firefox Tracking Flags

(Not tracked)




9 months ago
Most profiles show that poll() (or some OS equivalent) is where we spend most of our time. Doing so much stack walking when we know we're not doing any work seems like a waste to me. I often turn off the profiler just because it causes Firefox to use 10% or so of my CPU all the time and I worry it's draining my battery. Could we pause the profiler when a runnable finishes and then resume it when the next runnable will be processed? This is how the background hang reporter works.
This is a simpler-to-implement alternative to bug 929392, I suppose.
It wouldn't work on non-XPCOM/chromium threads though, and it might mean that we miss code that's run by the OS on our main thread.
You need to log in before you can comment on or make changes to this bug.