_sendPerformanceCounters is one of the common timer based wake ups in child processes
Categories
(Toolkit :: Performance Monitoring, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox68 | --- | fixed |
People
(Reporter: smaug, Assigned: tarek)
References
(Blocks 2 open bugs, Regression)
Details
(Keywords: regression)
Attachments
(1 file)
I don't know what _sendPerformanceCounters is used for, but it seems to run rather often in child process.
Reporter | ||
Comment 1•6 years ago
|
||
this is definitely among the most common wake ups on the main thread on otherwise rather idle child process (say, about:blank)
Anything we could do here?
Assignee | ||
Comment 2•6 years ago
|
||
_sendPerformanceCounters is called when we display some metrics in about:performance - This is supposed to run only when about:performance is open in one tab, if you see calls outside this use case, it's a bug.
One option would be to pause it when about:performance doesn't have the focus (but maybe that's the case?) adding Florian who's doing the UI
Reporter | ||
Comment 3•6 years ago
|
||
It runs all the time, even without about:performance.
Reporter | ||
Updated•6 years ago
|
Comment 4•6 years ago
|
||
(In reply to Tarek Ziadé (:tarek) from comment #2)
One option would be to pause it when about:performance doesn't have the focus (but maybe that's the case?) adding Florian who's doing the UI
When about:performance is in a currently invisible tab, we pause the UI refresh, but we keep collecting the data in the background because to display the energy impact column when the user switches back to about:performance, we need to compare the current data with the data from 2s before.
Reporter | ||
Comment 5•6 years ago
|
||
To clarify, I see the function being called after startup (and seemingly ongoing forever) when the only tab there is and has been is about:blank.
Assignee | ||
Comment 6•6 years ago
|
||
That would be a bug then, it's not supposed to be called but by that UI, I will investigate when I am back from PTO (next monday) - if you want someone else to look earlier don't hesitate to reassign it
Assignee | ||
Comment 7•6 years ago
|
||
oh... I was confused by the API name (wrt to the C++ side), sorry!
We have JS API calls counters we use in about:performance, and they are incremented in each child on each call. Kris asked me to add this timer so we would avoid keeping them in memory on each child. That timer grabs them and aggregates them in the parent in a single structure.
The simplest thing to do is to reduce the number of call by chaging the default here : https://searchfox.org/mozilla-central/source/modules/libpref/init/all.js#5184
5 seconds sounds fine.
We can do a more sophisticated thing if you think it's worth it, like triggering the timer only if the counters have reach a certain size in the child.
Reporter | ||
Comment 8•6 years ago
|
||
In the long run we should avoid using timers. We'll get way more processes and if each of them fire some timer, there will be quite some wake-ups.
But for now, I'll try increase that value.
Assignee | ||
Comment 9•6 years ago
|
||
Ok. I'll add a patch monday, or if you want it sooner feel free to do it
Assignee | ||
Comment 10•6 years ago
•
|
||
In the long run, I think the cleanest thing will be to trigger a 'flush' call when we reach n items in the child, and that can be checked everytime the counter is incremented. That will get rid of the counter altogether. I'll add a follow-up bug and work on this when I have more time.
Reporter | ||
Comment 11•6 years ago
|
||
Assignee | ||
Comment 12•6 years ago
•
|
||
Florian, I r+ the patch considering that 5s should not impact about:performance much since webext children are sending data every second right now and the UI is refreshing every 2 seconds (but we can tweak that value if needed -- before the beta release). When the UI is displayed, since they don't send the data at the same time, JS API dispatches are spreaded over a few seconds anyways and the trend is what really matters.
In the next version maybe we should add an explicit call to the children via the parent promise to have a better accuracy.
Reporter | ||
Comment 13•6 years ago
|
||
Anything which would get rid of the timer (at least when about:performance isn't open) would be great.
Comment 14•6 years ago
|
||
Comment 15•6 years ago
|
||
bugherder |
Assignee | ||
Updated•5 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Description
•