davtur19/DotGit

Twitch/Youtube performance issues

Closed this issue · 13 comments

m1ga commented

Hi, big fan of the plugin but today I finally found that it is the source why my Firefox is slowing down opening Youtube or Twitch.
Tried to add *.youtube.com, *.twitch.tv, *.ytimg.com to the exclude list but it still slows down rendering the videos or thumbnails. Is there any workaround to keep the plugin enable but have smooth video/streaming experience?

Are you sure it's the extension that slows down your browser so much?

In theory, once the domain has been visited, the extension should not visit it again, in fact it makes almost no request to me by visiting Twitch or YouTube, since many are already scanned, but if you often delete all (the trash can button with the x), then in that case the extension continues to revisit the same sites.

Try to see from about:performance if maybe another extension is giving you problems.

If you are sure it is DotGit, you could open about:debugging#/runtime/this-firefox click inspect on DotGit, and see what requests the extension makes under the network tab.

You could also try adding these:
YouTube: *.googlevideo.com
Twitch: *.abs.hls.ttvnw.net or maybe *.ttvnw.net

I think it might be a good idea to add these domains to the default blacklist, as the extension is starting to be used by more people and I wouldn't want to add unnecessary load to the network of these sites and DotGit users.
So if you have other similar sites to tell me, feel free to recomment the issue.

m1ga commented

Thanks for the quick feedback!

I'm pretty sure it's DotGit 😄 :

screencapture-2022-01-27_17.18.46_edit.mp4

when enabled you can see that it takes ages to load the preview images. Other videos running in different tabs stop. Disabling it works right away. Enabling it again and the thumbnails takes a long time again (caching is disabled, so it shouldn't load the images from cache). I had even click it twice to disable it since that tab was frozen too while youtube was finishing loading the images.

Interesting part: you are right, it doesn't re-check youtube again, I don't see anything in the DotGit network tab. So maybe it's the URL check?

Adding those excludes didn't change anything.

edit: i'm not logged into youtube; other extensions are: cookiebro and ublock. Disabling both didn't make any change.

I didn't expect it to be that slow, I thought it was an extra second, no more than 5 seconds.
I've noticed that it goes faster without extension to me too, but it's not extremely slow like you.
I have to investigate what the problem may be, perhaps reading the data saved on the extension disk, do you have an hdd or an ssd?
Or maybe just reading the entire array of sites visited if it's very large, but I haven't reset the extension in months, so my array should be huge.

m1ga commented

SSD, Firefox 95.0.2, Fedora 34 (kernel 5.15.16).

The checked array has 319 entries. It has multiple entries of the same pages:

  • wss://irc-ws.chat.twitch.tv: 57 times
  • wss://pubsub-edge.twitch.tv: 55 times

and (at least in the inspector) it starts with checked:"[" and ends with "https://lo". So perhaps thats broken?

m1ga commented

edit:

after deleting the checked array I got:

Uncaught (in promise) TypeError: storage.checked is undefined
    checkUrl moz-extension://6d27429e-5b9c-4443-add0-457c27cac02e/dotgit.js:643
    processSearch moz-extension://6d27429e-5b9c-4443-add0-457c27cac02e/dotgit.js:648
    processListener moz-extension://6d27429e-5b9c-4443-add0-457c27cac02e/dotgit.js:628
dotgit.js:643:5

but restarting the plugin fixed that.

it seems to be alot faster now

and (at least in the inspector) it starts with checked:"[" and ends with "https://lo". So perhaps thats broken?

Maybe they are leftover links from an old version that behaved differently.
I noticed that I had them too and did the same thing you did, but it still feels slow compared to having the extension disabled.

Now I'm trying to figure out with the profiler if there was any problem in particular.
Honestly I don't have much experience in js, I will try my best to fix it as it bothers me too.

On the chrome profiler I don't notice anything strange and I don't notice slowdowns, on FF I notice slowdowns but I can't find a profiler for extensions.
I guess it's some Firefox related problem with my extension.

I fixed a bug you found, I don't know if it will affect the loading time.

To remove duplicates you will need to reset the extension (button with the trash can).

m1ga commented

Performance is better. I'll keep testing...

Loading map on maps.google.com is very slow too

Just FYI: I have a lot of performance issues with your extension in Firefox (not sure about other browsers as I don't use it there) as well.

As soon as I turn on dotGit extension and refresh some page extensions process goes bonkers with CPU usage, turning it off makes it all go away.

That's really a pity, because I love your extension.

@domints
If you have installed it for a long time you could try clicking on the trash can icon to reset it (you will delete everything)
The problem may be due to a large number of requests that are queued and a slow connection
Unfortunately I find it difficult to debug this problem

In the latest versions the problem should have been fixed long ago, if the problem persists reopen the issue.