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

Performance regression in Firefox version 123 & 124 #224

Closed
Askejm opened this issue Mar 2, 2024 · 18 comments
Closed

Performance regression in Firefox version 123 & 124 #224

Askejm opened this issue Mar 2, 2024 · 18 comments

Comments

@Askejm
Copy link

Askejm commented Mar 2, 2024

Troubleshooter
First try all the checks and steps in the troubleshooter: https://github.com/WesselKroos/youtube-ambilight/blob/master/TROUBLESHOOT.md

  1. Did it solve your performance problems? yes/no
    No
  2. What steps made it worse/better:
    The lower quality settings helped somewhat, although i still get around 15-20fps

Describe the performance you are currently experiencing
3. Low performance on 4K, 50% res scaling. It only happens in Firefox as of lately. No problems in Chrome.

Device information
4. Name of your CPU: 5800X3D
5. Name of your GPU: 3090
6. Name of the browser: Firefox
7. Version of the browser: 123.0

Screenshots
8. Add a screenshot of the Task manager with the CPU and GPU usage charts
image
Taskmgr_TCARmNszsQ
Taskmgr_jeGHXaDNKs
10. Turn on the Ambient light setting Quality > Show framerate and make a screenshot of your framerates
firefox_Z4tWMxsTg5
Describe the performance you would be happy with
11. At least 30fps on 4k. I prefer the higher bitrate of 4k, but find the delay between scenes quite jarring. I know i can enable the fade duration, but would prefer not to

Describe any workaround you've tried so far
12. Fade duration and lower quality settings. They both mitigate it somewhat but is not something i am satisfied with.

Additional context
Add any other context or screenshots about the feature request here.
13. It only started happening a little bit ago. I am unsure if it's an automatic update, but I did recently update my driver which may have caused some issues with this plugin.

@WesselKroos
Copy link
Owner

WesselKroos commented Mar 2, 2024

Hi @Askejm, let's try to figure out what caused the sudden drop in performance. I'm on a Nvidia 2070 Super, so I might be able to reproduce your issue. Some follow up questions:

  1. Since it happens only on Firefox, Do you think it could have happend because of a Firefox update?

  2. Which Nvidia driver version are you currently on? And were you on?

  3. Could you try to see if reverting to the previous NVidia driver does indeed fix the problem? Or using the previous Firefox version?

@Askejm
Copy link
Author

Askejm commented Mar 2, 2024

Thanks for the quick response @WesselKroos

  1. Well I'm honestly not sure, but 123.0 released almost 2 weeks ago (20/02/2024). I feel like it has been an issue for shorter
  2. I am on 551.61 (22/02/2024) but I can't find which I was on
  3. Tried downloading 537.58 (10/10/2023) and its the same rn, around 10 fps on 4k

@WesselKroos
Copy link
Owner

WesselKroos commented Mar 3, 2024

It looks like you've found a Firefox version 123 bug. I hit the same framerate ~12 fps limit for a 4K video in Firefox. But after downgrading to Firefox 122 I was able to get 60fps.

I don't have a workaround for you at this moment. But I'll report this performance regression to the Firefox developers. Let's hope we can find a workaround for Firefox 123 in the mean time.

Running Firefox versions 122 and 123 side-by-side:

image

image

@Askejm
Copy link
Author

Askejm commented Mar 3, 2024

Oh thats odd. Well ill downgrade then, thanks!

@WesselKroos
Copy link
Owner

The bug has been reported to the Firefox developers:
https://bugzilla.mozilla.org/show_bug.cgi?id=1883225

@WesselKroos
Copy link
Owner

WesselKroos commented Mar 3, 2024

@Askejm I think I found a workaround. Could you verify that executing this javascript code on the /watch page fixes the bug in Firefox 123?
(Tip: You can install Firefox 122 and 123 in separate locations to run them side-by-side)

ambientlight.enableMozillaBugReadPixelsWorkaround = false

Because it looks like they have fixed bug 1719154 while introducing bug 1883225

@WesselKroos WesselKroos changed the title Bad performance after update on Firefox only despite 3090 Performance regression in Firefox version 123+ Mar 3, 2024
@WesselKroos WesselKroos reopened this Mar 3, 2024
@Askejm
Copy link
Author

Askejm commented Mar 3, 2024

@WesselKroos Looks like that did it.
image
Still looks a little bumpy on the graph it appears, but it seems fine to me

@Askejm
Copy link
Author

Askejm commented Mar 3, 2024

image
Sorry, heres the full stats

@WesselKroos
Copy link
Owner

Then I'll turn off that workaround from Firefox 123. I'll also make the workaround available via an advanced setting. Just in case Firefox decides to revert their change in 124.

@WesselKroos WesselKroos changed the title Performance regression in Firefox version 123+ Performance regression in Firefox version 123 & 124 Mar 11, 2024
@WesselKroos
Copy link
Owner

@Askejm
Copy link
Author

Askejm commented Mar 12, 2024

Then I'll turn off that workaround from Firefox 123. I'll also make the workaround available via an advanced setting. Just in case Firefox decides to revert their change in 124.

Did you push this update? I still get bad fps without running the javascript. Version 2.38.1 @WesselKroos

@WesselKroos
Copy link
Owner

@Askejm Not yet, it will be released in 2.38.2.

@WesselKroos
Copy link
Owner

WesselKroos commented Mar 12, 2024

@WesselKroos Looks like that did it.
image
Still looks a little bumpy on the graph it appears, but it seems fine to me

Those are some large consistent spikes, more than 2x the normal duration.

My graph seems to be a lot smoother:

image

Even when Firefox's rendering process is a half display frame desynced from the video frame (this alternates every 5 seconds on my pc), the duration (drawtime) stays similar for every frame:

image

Could you share a recording of the Graphics process for 10 seconds?
You can follow the steps in Firefox's profiler documentation to create one. Just select "Graphics" instead of "Firefox" in the popup: https://profiler.firefox.com/
image

@Askejm
Copy link
Author

Askejm commented Mar 14, 2024

Dont know why but its a lot better now
firefox_gcsKVAdil6

Firefox 2024-03-14 14.19 profile.json.gz

@WesselKroos
Copy link
Owner

WesselKroos commented Mar 14, 2024

Most of the stutters are just caused by changes on the webpage that the YouTube design has to recalculate things for.

For some you can reduce the duration. Because all 3 microstutters are partially caused by your Bitwarden extension. It is executing a getPageDetails and fulfilled function (for 95ms + 22ms) in intervals. And a CollectAutofillContentService/this.handleMutationObserverMutation function (for 37ms) when anything changes on the webpage. I can't see what html content it is checking (and I don't want to know), but the function names sounds like an auto-fill feature. Maybe you can turn this feature off in Bitwarden's extension settings. Or you could only disable the extension on the youtube.com domain.

Screenshots of the stutters (the red lines)

Stutter 1
image

Stutter 2
image

Stutter 3
image

@Askejm
Copy link
Author

Askejm commented Mar 14, 2024

Oh thanks i didnt know autofill would take so much. Thanks for the help! And ill be waiting for firefox v125 or 2.38.2!

@WesselKroos
Copy link
Owner

WesselKroos commented Apr 23, 2024

@Askejm I noticed that Firefox released version 125. Can you confirm that Mozilla has fixed the bug?

@Askejm
Copy link
Author

Askejm commented Apr 23, 2024

@WesselKroos Yes works all good now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants