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

this extension now makes google docs laggy as hell when dark mode is enabled #72

Open
TheShadowGamer06 opened this issue Jan 14, 2025 · 12 comments
Labels
bug Something isn't working urgent Needs to be fixed ASAP

Comments

@TheShadowGamer06
Copy link

TheShadowGamer06 commented Jan 14, 2025

Title, it updated to 1.1.0 and now docs is laggy as shit with dark mode enabled.
Windows 10, Firefox V134.0.1

@TheShadowGamer06 TheShadowGamer06 changed the title this extension is laggy as hell this extension now makes google docs laggy as hell when dark mode is enabled Jan 14, 2025
@fharrington
Copy link

Same happening here. When in light mode it's fine, click on the dark mode and tabs become very laggy.

Win 11, Firefox 134.0.1

@MistakeNot4892
Copy link

I am also seeing a lot of bad lag as of the update this morning. Ubuntu 24.04.1 LTS, Firefox 133.0.3

@waymondrang waymondrang added the confirm bug Confirm that something isn't working label Jan 16, 2025
@waymondrang
Copy link
Owner

waymondrang commented Jan 16, 2025

Hello, thank you for opening an issue. I am sorry that the update is causing lag. Unfortunately, I have not been able to experience this myself so it is difficult for me to determine the cause of the issue (Windows 11, Firefox v134.0.1).

Does the lag occur when you are trying to open a specific document? Is there still lag when opening a new document?

@MistakeNot4892
Copy link

I was seeing it right after the update this morning in a 120 page document, when I was trying to scroll or highlight text. I am not seeing any lag currently in the same document/session after leaving it alone for several hours to do other work. The document is just text and a table of contents, no images or embeds.

Right after writing this I tabbed back and had the same choppiness/lag when scrolling but only for a few seconds. I also get lag/choppiness if changing tabs away from the session and back. It seems quite inconsistent, sorry.

Turning off the extension does eliminate the lag.

A brand new document with 'asdasdas' as the only contents also lags when scrolling up or down with the extension enabled.

These are my current settings:

image

I will note as a potential issue, I am using an NVIDIA graphics card (GeForce RTX 2060 Rev. A) which has had issues with deadlocking Firefox before, but usually only if I have something running in Proton/Vulkan at the same time. I am not seeing any lag in other tabs.

@TheShadowGamer06
Copy link
Author

TheShadowGamer06 commented Jan 16, 2025

Hello, thank you for opening an issue. I am sorry that the update is causing lag. Unfortunately, I have not been able to experience this myself so it is difficult for me to determine the cause of the issue (Windows 11, Firefox v134.0.1).

Does the lag occur when you are trying to open a specific document? Is there still lag when opening a new document?

yeah it lags when opening a new document, everything was fine before the update so some line of code that got changed messed something up, and im not the only one

@TheShadowGamer06
Copy link
Author

TheShadowGamer06 commented Jan 16, 2025

not sure if its much help but i used the firefox profiler to get some performance graphs on docs with the extension on and with it off
image
first image with smaller green spikes is with darkmode off, second is with dark mode on and it has larger green spikes on the renderer, the cpu usage was pegged at 100%, it appears when i scrolled up and down, that was when the usage spiked
image

@waymondrang
Copy link
Owner

waymondrang commented Jan 16, 2025

Thank you all for providing context and @TheShadowGamer06 for providing profiler screenshots. I believe the issue may be due to the updated styling method which relies on overwriting the CSS :root variables by controlling the insertion of CSS files. The manipulation of CSS files can be seen in the following function:

docsafterdark/src/word.js

Lines 236 to 249 in c326421

function inject_dark_mode(dark_mode) {
mode = mode_dark;
remove_css_file("light.css");
remove_css_file("dark_midnight.css");
inject_css_file("docs.css");
inject_css_file("dark_normal.css"); // BASE DARK MODE
if (dark_mode.variant == dark_mode_eclipse) {
inject_css_file("dark_midnight.css");
// DO NOT REMOVE NORMAL DARK MODE CSS
}
}

This is different from the pre-v1.X.X versions, which used only one CSS file and did no such file manipulation. While this issue was not addressed in release v1.1.1, I will work to consolidate the :root variables and try to manipulate them via JavaScript instead. I appreciate your helpfulness and will keep this thread updated.

@waymondrang waymondrang added bug Something isn't working urgent Needs to be fixed ASAP and removed confirm bug Confirm that something isn't working labels Jan 16, 2025
@DagonMDragoon
Copy link

DagonMDragoon commented Jan 16, 2025

I too am having this issue but also the document background is remaining white, I am unsure if this is linked to the lag issue. I have also noticed that when light mode is activated with the extension's mode switch icon thing that the lag goes away. I hope this information helps.

ETA: am on windows 10 and firefox, both are the latest versions.

@TheShadowGamer06
Copy link
Author

TheShadowGamer06 commented Jan 17, 2025

@waymondrang I have uploaded the two profiles here if you want to look at them in closer detail, perhaps they may offer you more information to confirm your suspicions:

dark mode off: https://share.firefox.dev/4anNi6Q

dark mode on: https://share.firefox.dev/4gXAoyW

@waymondrang
Copy link
Owner

waymondrang commented Jan 17, 2025

Thank you @TheShadowGamer06 again for sharing the profiles. I have a suspicion that the CSS filter properties are causing the increased graphic computation; the document invert functionality and icons in dark mode rely on the CSS filter property.

@TheShadowGamer06 and @MistakeNot4892, Does this lag still occur when the document invert option is off?

Image

@TheShadowGamer06 If it wasn't already disabled in your "dark mode on" profile, could you please provide a profile with the document invert option off?

Edit: In my own testing in Firefox on my Ubuntu v22.04 machine, the document invert seems like the likely culprit for the increased renderer usage.

@TheShadowGamer06
Copy link
Author

yes @waymondrang when I turn off the invert option, the lag seems to go away, here is a profile with dark mode on, invert off:

https://share.firefox.dev/40n3CAl

@SpeedyG2H
Copy link

Hello. Made a GitHub account just to comment this thing I noticed to hopefully get this bug fixed (I love DocsAfterDark and I use Docs often).

I've noticed that for me, it lags depending on where I have the typing cursor is placed in the document. If I scroll around and past where it's placed, it'll lag for a page or two then when I get far enough away it's just fine. I have a 50 page long document that I can scroll through pretty lag free as long as I leave the typing cursor at the top of the doc.
It only seems to be affecting scrolling and not really much else.

I'm not sure if anyone else experiences it like this, but I hope this helps at all in some way.

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working urgent Needs to be fixed ASAP
Projects
None yet
Development

No branches or pull requests

6 participants