Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enourmously slows down chrome. #3

Closed
schmorp opened this issue Aug 30, 2023 · 36 comments
Closed

Enourmously slows down chrome. #3

schmorp opened this issue Aug 30, 2023 · 36 comments
Assignees

Comments

@schmorp
Copy link

schmorp commented Aug 30, 2023

Enabling this extension slows down chromium a lot and incrreases CPU usage enourmously., Tab switching normally takes <0.2s, but with this extension enabled, it takes 1-2s or sometimes even more, at high cpu usage.

@jrie
Copy link
Owner

jrie commented Aug 31, 2023

Hi, based on what the extension is allowed to do by permissions and what is used from inside the "tab" api, there is not such a thing as interacting with the browser on tab switching. Flag Cookies does not actively monitor this tab events.

@schmorp
Copy link
Author

schmorp commented Aug 31, 2023 via email

@jrie
Copy link
Owner

jrie commented Sep 1, 2023

@schmorp , I tested on Chromium v116.0.5845.140 and I cannot reconstruct this issue.
Do you make use of the "Memory Saver" feature of Chromium?

My best guess at this point would be, that when either the "Memory Saver" does its job - the tab load may be slowed down as those tabs became hibernated before and data has to be "reloaded", also the data of Flag Cookies, depending on how huge the cookie data is for each tab.

Another issue might be that your computer swaps the browser and or addon data, reloads it of a disk, which again would take quite some time to resume. I do not think that this case will happen, but it realy depends on your hardware/setup and browser usage/stats.

@cheater
Copy link

cheater commented Sep 7, 2023

I'm having the same issue in Firefox 117 on Windows. I just installed FlagCookies the other day, and my Firefox took on the order of minutes to respond to clicks. I think it might be because I have a massive amount of tabs and windows open (I'm a power user alright).

@cheater
Copy link

cheater commented Sep 7, 2023

Oh, also, eventually it leads to Firefox crashing. Restarting it does not help - it's still impossible to use the browser after a restart. The only thing that restores the browser to normal operation is disabling FlagCookies. Without FlagCookies, Firefox responds instantly to my inputs.

@jrie
Copy link
Owner

jrie commented Sep 14, 2023

Thank you for your feedback. I am not sure on how much impact the addon has on your browsing experience. But this sounds bad and is unfortunate.

I am not exactly sure on how to start troubleshooting this issue. What might happen, a lot of data (cookie information) is processed in your cases. For some domains this might turn to a bigger amount of cookie information, the displayed data, the logging information as well as what is loaded into the browser storage and needs be processed by the browser for the addon to work accordingly. This might apply across all tested browsers.

FlagCookies does also do a lot of background work, meaning, if there is a lot of "background loading" in a tab, for example by XMLHttpRequests/AJAX, or other changes like cookie "activity", things might become crowded if the tab is kept open in the background and such loads, or activity is done. I just can imagine, a lot of (cookie) name data is collected and needs to be sorted out for the extension to work, and things become crowded.

In order to improve the situation for this particular use cases, I would require more information. For example how big the stored data of FlagCookies is - meaning the overall settings, profile mode cookies, and other settings which apply for domains/tabs and such.

Since this might be sensitive or private information, you can also drop me an email.

@cheater
Copy link

cheater commented Sep 14, 2023

How would i find that out?

@jrie
Copy link
Owner

jrie commented Sep 15, 2023

Hi @cheater - in Firefox you can visit the about debugging page.

about:debugging

ATTENTION: This cookieData will have the cookie information, DO NOT POST THIS PUBLICLY!

There, you select "This Firefox" or "Dieser Firefox" in German and scroll in the extension list to "Flag Cookies" and click on "Inspect" / "Untersuchen". In the new window you click on "Debugger" and select "Flag Cookies" in the list.

To see all the data Flag Cookies uses for "cookies", enter in the console:
cookieData

And press enter - this will show an "Object {..." something, if you click on this, it will show you all data stored in the cookie information store. Depending on how much data there is, this might take some time.

If you want to copy this data, you click right on "Obect {..." and choose "Copy object". All that data is in the clipboard then.

The same can go for "logData" (like the "cookieData"), and "logTime".

@jrie
Copy link
Owner

jrie commented Sep 24, 2023

I was working on some changes during the weekend. Improving some of the data usage and also improved the code to not store as much temporary information for cookies and there data, stripping out non required details.

Also the cpu usage should be not as heavy if logging will be switched off, plus point, less data.

I try to get this version soon ready.

@jrie jrie self-assigned this Sep 24, 2023
@cheater
Copy link

cheater commented Oct 14, 2023

can you push out the new version? I wanted to try it out before i blow up my computer with the old version again

@jrie
Copy link
Owner

jrie commented Oct 14, 2023

Hi @cheater - I just pushed the new version. Please take a closer look!

There are some smaller improvements, some smaller enhancements and some simplifications across the addon as well as some more housekeeping.

Please let me know, if this version is working better for your use case! 👍

@cheater
Copy link

cheater commented Oct 14, 2023

how do i get it? it's not on AMO and i don't see a place on github to get the xpi.

@jrie
Copy link
Owner

jrie commented Oct 14, 2023

You can download the repository and then use the about:debugging URL in the address bar of Firefox.
There, select "this firefox" and click on "load temporary addon" and navigate to the folder of FlagCookies, containing the manifest.json.

@cheater
Copy link

cheater commented Oct 15, 2023

well, it doesn't slow down my browser now, but also it doesn't do anything. when i go to export cookies (which is why i'm using flagCookies in the first place - to use with jdownloader), it just gives me this string:

{"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/118.0"}

those are not my instagram cookies...

@farOverNinethousand
Copy link

farOverNinethousand commented Oct 16, 2023

@cheater
Close all open browser tabs, close your browser, re-open your browser and check if it works now.

@cheater
Copy link

cheater commented Oct 16, 2023

what? no. i'm not closing my tabs to test something. it makes no sense. and besides, i'm on firefox, not chrome.

@farOverNinethousand
Copy link

farOverNinethousand commented Oct 16, 2023

I've edited my post accordingly.

I was able to reproduce the issue under Chrome too hence my initial post was about Chrome.
If you are not willing to invest some time into testing developers' changes, maybe you shouldn't report bugs at all on this platform.

@cheater
Copy link

cheater commented Oct 16, 2023

what are you even talking about? i reproduced the issue, and jrie made a new version, i tested that, and it's broken because it does not do anything. you're out of your mind dude. go annoy someone else.

@farOverNinethousand
Copy link

Okay again:
I was able to reproduce a similar issue in Chrome using a very similar addon.
In Firefox, it is working fine for me with Instagram now. When it wasn't working, this is what I did:
Close all open browser tabs, close browser, re-open browser and check if it works now.

I've attached a screenshot which shows that the new build is working fine with Instagram after a browser-restart.

FlagCookiesIG

@jrie
Copy link
Owner

jrie commented Oct 16, 2023

Hello. I am working on some fixes to FlagCookies since the last upload to Github.

These changes will hopefully change the error of disapearing cookies under some circumstances.

I believe the new version might soon be ready at the weekend after this week, or something between this lines.

Please bare with me.

@cheater
Copy link

cheater commented Oct 17, 2023

No worries, let me know when you're ready.

I wanted to provide a suggestion on your coding technique. I've been trying to debug the issue by going over the git log. However, it's unusable. You do massive commits where everything is thrown in. It would be much more useful - also to yourself - if you made commits more granular. Just one small change in functionality, and then commit. It doesn't cost much. Make sure the plugin still is in working order when you commit. So for example, if you'll be replacing a bunch of code, try to replace it step by step rather than everything in one go. This way, you could right now go through the git history, and find where the issue started happening, with more granularity than we can do right now. Currently it's only possible to narrow this down to a diff with thousands of lines.

If you have to program a bunch of stuff before you can figure out what you'll be doing, try using the git gui command. It opens a visual commit window. In the file view, you can use your mouse to select single lines to add to the staging pool to commit them. This way you can select out a feature made up of disjoint lines and commit it all in one go while also not committing lines that are not related to it. It's much better than the text-interactive version in the command line, which technically allows you to do something similar, but the user interface is so confusing you can lose track of what you want to do.

Good luck on the debugging! Take your time.

@jrie
Copy link
Owner

jrie commented Oct 19, 2023

I updated the code base here at Github. This version should fix the reported issues.
This is a larger commit, once more, but there have been a lot of changes (for better!).

@jrie
Copy link
Owner

jrie commented Nov 8, 2023

@cheater @schmorp - a update is live here at Github which further should trim down the memory and cpu usage. Also for power users. This is also a bugfix release.

I would be glad if you could test the version 3.3.0 here from Github.

@cheater
Copy link

cheater commented Nov 8, 2023

it works, copies the cookies to the clipboard, and (after only a minutes of use) doesn't seem to be slowing down the browser. well done! thank you for fixing it :) you should publish it to AMO.

@cheater
Copy link

cheater commented Nov 8, 2023

Would you mind telling us in detail what you did to make it perform better? I'm curious and would like to learn from your experience :)

@cheater
Copy link

cheater commented Nov 8, 2023

(btw i'm on FF. haven't tried on chrome, i don't use it, i have it installed but i have 0 tabs open and websites logged in, so i don't think that would help)

@jrie
Copy link
Owner

jrie commented Nov 8, 2023

Would you mind telling us in detail what you did to make it perform better? I'm curious and would like to learn from your experience :)

From what I did:

  • disabling action log by default which made a lot of function calls, rewrites and temporary stored informations on a per tab base.
  • disabling of removed and permitted cookie display in mouse over icon text display.
  • reducing the memory usage of what cookie contextname/storeid is saved by every cookie to only the root domain .
  • made regular expressions/regex match only the beginning of string urls.
  • correct assignments of cookie states inside the cookie handling which are set also on cookie updates, overwrites, and removal.
  • cookie handling now escapes quicker if a previous call removed a cookie, this was previously more work.
  • removed duplicated handledCookies data field and improved cookieData to have a more clear structure and no abundant information.

At least those are the most Important changes from my side.

@cheater
Copy link

cheater commented Nov 8, 2023

Thanks! That sums it up well. One question... will JDownloader still be able to use the cookies, or is the "copy to clipboard" format different now?

@jrie
Copy link
Owner

jrie commented Nov 9, 2023

Thanks! That sums it up well. One question... will JDownloader still be able to use the cookies, or is the "copy to clipboard" format different now?

The format has not changed, so the export to clipboard should work as expected.

I plan to upload a new version tomorrow or Saturday here at Github which will fix some errors I noticed when testing the addon in Chrome and Opera, which did not fire in the Firefox codeparts explicitly.

@cheater
Copy link

cheater commented Nov 12, 2023

Thanks! That sums it up well. One question... will JDownloader still be able to use the cookies, or is the "copy to clipboard" format different now?

The format has not changed, so the export to clipboard should work as expected.

I plan to upload a new version tomorrow or Saturday here at Github which will fix some errors I noticed when testing the addon in Chrome and Opera, which did not fire in the Firefox codeparts explicitly.

are you suuuure nothing's changed? because when I use those cookies in JDownloader now, it can't log into instagram. I tried another thing called Cookie-editor that's now also supported by JDownloader. Cookies copied out of it log me in fine. However, the format is different, and also it includes more cookies.

So if the format is the same as it was before, then I assume JD supports two different formats: yours and Cookie-editor's. But maybe you have an issue where you aren't capturing all the cookies anymore?

Try comparing the output on instagram yourself (you have to be logged in).

@cheater
Copy link

cheater commented Nov 12, 2023

For example, Cookie-editor includes cookies named "sessionid", "mid", "ig_did", and a bunch more and those cookies are not included in the output from the latest version of flagCookies.

@jrie
Copy link
Owner

jrie commented Nov 13, 2023

For example, Cookie-editor includes cookies named "sessionid", "mid", "ig_did", and a bunch more and those cookies are not included in the output from the latest version of flagCookies.

I am in touch with someone of the JDownloader team and we tested the login in JDownloader2. This does work on Instragram with the exported cookies into clipboard.

In any case, you might need to reload the tab for FlagCookies to update the temporary cookie information. Or in worst, once restart the browser - but a tab reload also should to the trick.

@cheater
Copy link

cheater commented Nov 13, 2023

Have you guys tried with Facebook Container turned on? (that puts Instagram and other FB owned entities in their own tab container).

I reloaded the tab when I was testing, but I did not restart the browser - I don't see what that would do since the addon is loaded as a temporary addon.

@jrie
Copy link
Owner

jrie commented Nov 13, 2023

Hi. I have not tested Facebook Container, so I cannot tell if this will work. But support for contexts / contextual identities - was added some time ago. In Firefox in particular, you always see the "active container group" information underneath the currently active website/domain name.

Regarding the browser restart, indeed, if the addon is temporary installed, FlagCookies will become dropped - this only applies to a non-temporary installation.

Reloading the website, after FlagCookies has been added temporary and is enabled, updates the cookie information accordingly. Then you should see the cookies for Instagram or any other page.

@jrie
Copy link
Owner

jrie commented Nov 13, 2023

@cheater , I opened up a new issue here: #6 regarding the (currently) broken container group support in Firefox.

@jrie
Copy link
Owner

jrie commented Nov 24, 2023

Github version 3.4.0 is live which received some changes, which further should trim some temporary stored informations.
This version also adds browser session display and, for now, the option to clearthe session and locale browser storages used by many websites.

@jrie jrie closed this as completed Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants