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
fix: Don't render LoadingSpinner after it has faded out #5164
Conversation
Hi @jviide, thanks for the PR! I'll review it tomorrow. |
I modified the approach. Instead of observing The length of this "transition grace period" is 500 ms by default to accommodate the current 250 ms transition. I made this change after realizing that there may be situations when the transition events never get dispatched. For example, the user might switch accounts just right, making visible a webview that has already finished loading in the background. Then the transition from opacity 1 to 0 never happens. |
Tested manually. Looks good! |
Again thank you very much @jviide! I'll notify you as soon as the release including this PR is published. |
Is there anything I could do to help get this change into production? The ability to squeeze a bit more battery life out of my laptop would be lovely :) |
Hi @jviide, your fix will go live with v3.27. We plan to ship this release early next week. |
@bennycode @ffflorian @Yserz I'm running into the same issue as @jviide and would greatly appreciate a new release. In its current state wireapp drains battery like crazy. |
Hi @marvinhagemeister, unfortunately our release got pushed back so it comes later than I anticipated. I am also not working at Wire anymore so my successor will take care of it. |
Still waiting for this to go in, and for M1 support (Electron has had M1 support for well over a year). |
@Yserz Is there any news when this might finally land on desktop on Macs? Desktop is still stuck at 3.26 |
This is crazy that it's taking months to go in - is this not something that can be part of a Wire Web update? I was under the impression those happen weekly, yet here we are nearly half a year later. |
Can confirm that this is still an issue in January 2022 - after using the uBlock-based workaround suggested here, my CPU usage at idle is a lot less. |
Seems that a version containing this PR has now been released to Mac App Store. |
This pull request attempts to reduce Wire's CPU usage when idle.
In the discussions related to issues #2507 and #2239 (and maybe elsewhere) @charlag et al. tracked down a culprit for some surpsingly high constant CPU load. The LoadingSpinner component is always rendered on top of the rest of the UI with 0 opacity after it has initially faded out, continuously using resources.
This pull request addresses the issue
by hooking to thegiving the fade out transition a fixed amount of time to finish. After this the component returnsonTransitionEnd
andonTransitionCanceled
events and set a flag marking the fade out completednull
, effectively removing the LoadingSpinner contents from the DOM tree.Personally, I've noticed constant ~15% load when Wire was idling on my M1 MacBook Air. Launching Wire with devtools enabled and removing the spinner from the DOM drops the idle CPU usage to near zero. I couldn't get the build infra work 100% on my machine, so @ikisusi and @esatormi volunteered to test this patch on their Intel Macs, both getting similar results. @ikisusi's CPU activity monitor looked like this before applying the patch (and after the spinned had faded to 0 opacity):
And like this after applying the patch: