Rocket.Chat.Electron icon indicating copy to clipboard operation
Rocket.Chat.Electron copied to clipboard

3.0.7 perfomance on Mac OS

Open no-nice-username opened this issue 3 years ago • 10 comments

My Setup

  • Operating System: Mac OS 10.15.7
  • App Version: 3.0.7
  • Installation type: dmg
  • [x] I have tested with the latest version
  • [x] I can simulate the issue easily

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

no-nice-username avatar Nov 23 '20 13:11 no-nice-username

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

Rollback to 3.0.6 until this will be fixed

TitaniumHocker avatar Nov 24 '20 08:11 TitaniumHocker

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.

StefanRied avatar Apr 29 '21 09:04 StefanRied

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

Weuxel avatar Dec 20 '21 11:12 Weuxel

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

jeanfbrito avatar Jan 12 '22 02:01 jeanfbrito

@jeanfbrito The issue persists in 3.7.5, too.

Weuxel avatar Jan 12 '22 05:01 Weuxel

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.

StefanRied avatar Jan 12 '22 07:01 StefanRied

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.

jeanfbrito avatar Jan 12 '22 11:01 jeanfbrito

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.

StefanRied avatar Jan 12 '22 12:01 StefanRied

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.

jeanfbrito avatar Jan 12 '22 12:01 jeanfbrito

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.

StefanRied avatar Jan 12 '22 12:01 StefanRied