RocketChat / Rocket.Chat.Electron

Official OSX, Windows, and Linux Desktop Clients for Rocket.Chat
https://rocket.chat/
MIT License
1.59k stars 698 forks source link

3.0.7 perfomance on Mac OS #1890

Open no-nice-username opened 3 years ago

no-nice-username commented 3 years ago

My Setup

Description

Latest desktop client is a resource hog even for electron. I do see visible delays when typing and CPU usages spikes up to 60%+ (considering I'm running mbp 16" with i9). It even consumes 10-20% on idle and my estimated battery time drops by an hour as soon, as I start intensive messaging.

Screenshot 2020-11-23 at 16 07 03

Current Behavior

CPU usage is way too high

Expected Behavior

CPU usage should be near zero, as this is just typing

TitaniumHocker commented 3 years ago

Have same problem on 3.0.7 installed from archlinuxcn. OS: Manjaro GNU/Linux

Rollback to 3.0.6 until this will be fixed

StefanRied commented 3 years ago

The problem still exists with the current 3.1.1. Electron Version on the Mac. The main reason seems to be animated emojis. If I have a chat selected with at least one animated emoji, the app directly consumes 40% of a CPU core, which is a lot power on a current Macbook Pro. However, if I select a text only chat without animated emojis, the CPU consumptions goes immediately down below 1% - as it should be for a real simple app like a chat client.

So what we need is

  1. A setting to switch the animation of emojis totally off - if you experience this issue - as a fast workaround.
  2. Some intelligence in the electron app, to detect if the main window is showing some animations. Then you would have nice animation, while you work in RocketChat, and low CPU consumption while you focus on other apps. Please checkout the Discord.app on the Mac. It solves the issue in exactly the this way. High CPU consumption in Electron on the Mac by animated emojis is a KNOWN PROBLEM for some years now.

Thanks for considering a fix.

Weuxel commented 2 years ago

Still an issue in 3.7.0. Maybe worse as my fans spin constantly because of this since version 3.7.0.

jeanfbrito commented 2 years ago

Can you test the 3.7.5 release? There is a lot of updates on the last releases that may have fixed this.

Weuxel commented 2 years ago

@jeanfbrito The issue persists in 3.7.5, too.

StefanRied commented 2 years ago

Yes, I can confirm this. Clearly, if an animated gif emoji is in the selected channel, the CPU consumption goes up to 50% of a CPU core. This makes the app unusable on older Macbooks.

jeanfbrito commented 2 years ago

Ok, I think that the @StefanRied suggestion about stopping GIFs are a solution to try. I will take a look in what can I do to stop them in background and adding a setting to disable them at all.

Thanks for confirming the problem.

StefanRied commented 2 years ago

This would be much appreciated. I had a similar problem in another messaging app based on electron years ago and it could be tracked down to the performance consumed by the GIF animation. Maybe as a first step, switching the animation of totally (based on a user setting) validates the root cause. Once we are sure, somebody could do a cool algorithm to let animated emojis run for example x minutes after they became visible.

jeanfbrito commented 2 years ago

This would be much appreciated. I had a similar problem in another messaging app based on electron years ago and it could be tracked down to the performance consumed by the GIF animation. Maybe as a first step, switching the animation of totally (based on a user setting) validates the root cause. Once we are sure, somebody could do a cool algorithm to let animated emojis run for example x minutes after they became visible.

This is an issue even in browsers, but Electron tends to have worse performance with GPU things. I will be investigating this, maybe a better GIF handling in all the chat would be great too.

StefanRied commented 2 years ago

The problem was far less visible in Windows than it is in macOS. The reason is the different multitask implementation. It is weil known that a single page/Tab in Chrome turns the fans on on a Intel based MacBook, if there are many animated hit on it.