aw-watcher-web icon indicating copy to clipboard operation
aw-watcher-web copied to clipboard

High CPU Usage on opening of new Tab

Open watertrainer opened this issue 3 years ago • 5 comments

Hello,

During my usage of this watcher I noticed a spike in my cpu usage and after a few tests it turns out, that this is caused by this watcher. I looked at my cpu usage in task manager in safe-mode and without safe-mode and with Activity-Watch enabled, it took ca.15% more cpu. Espacially while spamming the new tab button, cpu usage with the addon was 20-25% higher than without it. (I uninstalled any other addon which was installed previously, but the issue remained) Let me know if you need any further information, I'll be happy to provide it.

watertrainer avatar Oct 30 '20 22:10 watertrainer

Which process was it that used more CPU usage, was it aw-server or the browser?

johan-bjareholt avatar Oct 31 '20 08:10 johan-bjareholt

My browser was using more cpu

watertrainer avatar Oct 31 '20 09:10 watertrainer

The watcher is very simple, it only fetches info about a tab when it changes and sends it to aw-server. It should be at least a hundred fold less CPU intensive than the task of opening a new tab itself.

To solve this you must either pinpoint down the reason why it is so slow yourself or someone else needs to be able to reproduce your issue and do it for you. There are performance profiling tools for chrome and firefox that you could try out, but I have no experience with those. I could try and see if I could reproduce this sometime, but i doubt that I will be able to.

johan-bjareholt avatar Oct 31 '20 16:10 johan-bjareholt

I tested the watcher and found, that it seems to hold the data for a few seconds (in which it has relativley high CPU and RAM usage) until it writes the data and the RAM and CPU usage goes down again. I assume this was to reduce the frequency of Disk writes, so I'm not sure if disabling it would reduce CPU and battery usage overall?

watertrainer avatar Nov 06 '20 19:11 watertrainer

The watcher never does not do any operations on disk or holds the data, but aw-server will. But in that case the CPU usage should go up on aw-server, not on the browser. Regarding disk usage aw-server-rust improves performance a lot, you could try if that solves the problem.

johan-bjareholt avatar Nov 07 '20 11:11 johan-bjareholt