Wire-desktop: High CPU usage.

Created on 1 Nov 2016  Â·  22Comments  Â·  Source: wireapp/wire-desktop

Hi,

I started using the app yesterday and noticed a really high cpu usage with the 2.11.2666 build on arch linux. This issue might be linked with the macOS battery ones : https://github.com/wireapp/wire-desktop/issues/122

nov01-13 32 46

Most helpful comment

I was trying to investigate a little bit, here's what I found:

  • It definitely depends on the currently active conversation. Right now I have several conversations, opening some of them results in constant 30% CPU usage, opening others immediately drops to 0% CPU usage.
  • It doesn't seem to depend on the content in the currently visible area. One high-cpu conversation has only text in the visible area, while another conversation uses 0% CPU and has youtube video and a link as the last messages.
  • It doesn't seem to depend on the age of the last message in the conversation, e.g. one of the conversations that had no messages for the past 2 days is a high-cpu consuming one.
  • It doesn't seem to depend on the ongoing download/decryption activity, e.g. I left Wire open on a high-cpu tab for more than an hour, I didn't touch Wire during this time, nobody wrote or called me during this time, and CPU usage is still ~30%.
  • The CPU usage per conversations is persistent, i.e. I restart Wire and all conversations have the same behavior, high-cpu consuming remain high-cpu consuming, and low-cpu consuming remain low-cpu consuming.
  • Chrome DevTools shows nothing significant on the Rendering and Animation tabs.
  • Chrome DevTools is showing a difference on the JS CPU profiling, but it is a cryptic one:

    • This is a ~10 sec recording when a high-cpu conversation is opened:

      image

    • And this is a ~10 sec recording when a low-cpu conversation is opened:

      image

Notice the difference in the something called (program), on a high-cpu conversation this takes 2 out of 10 seconds to compute, while on a low-cpu conversation it consumes almost nothing.

Google search tells me that (program) is a chrome instance itself, but this CPU usage is clearly induced by Wire somehow, as different active conversations produce different results.

Does anyone have any suggestions on how to dig deeper and learn what actually is happening during those 2 out of 10 seconds?

By the way, if someone is interested but cannot reproduce locally, I'm open to a screensharing session 😉

All 22 comments

Same here on 2.11.2666.
screenshot_2016-11-01_17-53-22
screenshot_2016-11-01_17-53-54

Thanks for the help. So this was when the app was idling. Or was it doing anything specific. Running a call, displaying a gif or processing incoming messages?

When i start the app is taking a lot of ram and cpu and after that displaying a gif.

I checked again, it's on idle but gif are present in the conversations.
If I close the window, the app is still running in background ( i think) the usage goes to less than 5 percent.

Hope it helps.

is 7-10% cpu load during a call on i7-2600 considered normal?

I have noticed high CPU usage on Ubuntu 14.04. I was doing a video call and it was using nearly 50% of my CPU.

Hi!
I also noticed a "high" CPU usage in idle of Wire, approximate 16-18%. I use Mac OS X 10.11.6 and here it is not the process of the Wire.app itself, the load is produced by a separate process called "Wire helper". What does this extra process in the background, constantly?

Update: Suddenly the process "Wire helper" stops to "eat up" the CPU…

I also see Wire using ~15% CPU when it is idling. However this bug reproduces only when _certain_ conversations are open. In other words, select one conversation, switch to another app and do something else for a minute, then observe the CPU usage of Wire process and notice that it is constantly ~15%. Select another conversation, do something else for a minute and observe 0% CPU usage of Wire process.

I don't see any obvious connection between the conversations that do and don't produce high CPU usage:

  • it's not a matter of having gifs (I have one conversation where the CPU usage is high and yet there are no gifs)
  • it's not a matter of total history size (I have one conversation with definitely a large history, and yet the bug does not reproduce for it).

And as someone else pointed out, close Wire window and CPU usage drops to 0%, for any conversation.

Yeah, I have to revise my last post. It started again using constantly about 15% CPU usage. But as I got no feedback, I switched now to an app called Franz. Which can handle a lot more messengers and with no uncertain CPU usage.

@nfind you may want to monitor your CPU usage further, I don't think using Franz will solve the issue. In fact I don't think this is a wire-desktop issue at all, I think it belongs to wire-webapp, and so whatever client you use (let it be wire-desktop, Franz or a browser) you will experience this issue. Maybe just like in my case, depending on which conversation is opened the bug is or is not reproducible for you, or maybe there is some other condition.

I can actually reproduce this in Google Chrome.

I think this is a severe issue, I was wondering lately why the battery on my laptop degraded so quickly, until I stumbled on this bug. I can say now that it is true, my battery lives considerably longer with having Wire window closed.

First thanks for all the input and comment. I finally had some time to debug. There are several issues that (might) cause this:

  • GIFs (play on user action should improve this see #120)
  • offscreen css animations (realized that the image placeholder causes some repainting)

Reworking the image loading a bit, so i will try to knock down these issue.

Awesome that you may found some things that could cause this issue!

Some observations from me, running 10.12.3 with Wire 2.11.2686:
When I open a conversation Wire Helper consumes about 10-15% CPU in idle, it doesn't matter whether Wire is freshly opened or not. But when I hide Wire with CMD + H the CPU usage drops to 0% immediately.

Another observation: The bigger the wire window the higher the CPU usage is for me. On a 1080p screen with a maximised Wire window it stays at around 20-25%.

Same here (Ubuntu 16.04, Wire 2.11.2685). Only some conversation windows cause 20-25% CPU usage (no GIFs or animations). When the main window is closed, the CPU usage is below 2-3%.

I've just noticed a massive CPU usage during calls. I'm using Kubuntu 16.10 and the AppImage v2.11.2722. When making a video call I got 90% CPU usage cannot use a browser anymore, for example. The person which I called had a similar high usage, using Windows 10. I think we both have an intel i5-4300U CPU. We did not send any GIFs. When idling -without any calling going on- everything seems to be fine.

//edit: we did write some text though, so it could be a dublicate of #407. I'll try to make a call again, soon.

Can confirm the issues with wire helper. Wire helper constantly uses 30% cpu (as reported by activity monitor on macOS) while the wire app is in foreground. Would be really nice if this could be fixed.

I was trying to investigate a little bit, here's what I found:

  • It definitely depends on the currently active conversation. Right now I have several conversations, opening some of them results in constant 30% CPU usage, opening others immediately drops to 0% CPU usage.
  • It doesn't seem to depend on the content in the currently visible area. One high-cpu conversation has only text in the visible area, while another conversation uses 0% CPU and has youtube video and a link as the last messages.
  • It doesn't seem to depend on the age of the last message in the conversation, e.g. one of the conversations that had no messages for the past 2 days is a high-cpu consuming one.
  • It doesn't seem to depend on the ongoing download/decryption activity, e.g. I left Wire open on a high-cpu tab for more than an hour, I didn't touch Wire during this time, nobody wrote or called me during this time, and CPU usage is still ~30%.
  • The CPU usage per conversations is persistent, i.e. I restart Wire and all conversations have the same behavior, high-cpu consuming remain high-cpu consuming, and low-cpu consuming remain low-cpu consuming.
  • Chrome DevTools shows nothing significant on the Rendering and Animation tabs.
  • Chrome DevTools is showing a difference on the JS CPU profiling, but it is a cryptic one:

    • This is a ~10 sec recording when a high-cpu conversation is opened:

      image

    • And this is a ~10 sec recording when a low-cpu conversation is opened:

      image

Notice the difference in the something called (program), on a high-cpu conversation this takes 2 out of 10 seconds to compute, while on a low-cpu conversation it consumes almost nothing.

Google search tells me that (program) is a chrome instance itself, but this CPU usage is clearly induced by Wire somehow, as different active conversations produce different results.

Does anyone have any suggestions on how to dig deeper and learn what actually is happening during those 2 out of 10 seconds?

By the way, if someone is interested but cannot reproduce locally, I'm open to a screensharing session 😉

Figured it out, it is a three-dots animation running above the images until they are loaded that makes some conversations consuming lots and lots of CPU. To check for yourself, just start wire with --devtools, open a high-cpu consuming conversation and execute jQuery(".image-placeholder-icon").remove() in the console - the CPU usage will immediately drop to 0%.

The bug is filed as https://github.com/wireapp/wire-webapp/issues/1112, let's hope we get a quick hotfix - I can't stand seeing my laptop's battery dying so quickly because of Wire.

Maxim, great analysis! I can confirm that jQuery(".image-placeholder-icon").remove() in devtools console reduces CPU usage to almost 0 (Ubuntu 16.04, latest Wire 2.13.2739 from the PPA) in every chat you execute it.

Can confirm as well. This fixes the issue. Awesome analysis maxim!

Thanks everyone for reporting!

Closing this since the issue was fixed in https://github.com/wireapp/wire-webapp/pull/1115 and will be included in the next release. :slightly_smiling_face: Feel free to reopen if the issue persists.

If I leave wire running for some time, it does the same. Fans start whining and I have to restart wire to fix it. This is on macOS 10.15.4 with wire 3.18.3728

Was this page helpful?
0 / 5 - 0 ratings