High CPU usage while scrolling

Running Joplin-1.0.179.AppImage on Manjaro Linux 18.1.5, KDE (which I don’t think is relevant to this issue I’m reporting).

I observed that I get high CPU usage when I’m scrolling through note even when the layout is suppose to show the source (no rendering markdown to html):

As you can see in the screen-capture, joplin is not syncing or anything else other than scrolling through the text.

What browser do you use? Do you get the same problem with it?

I suspect it may not be specific problem to Joplin or Linux.

BTW I see the same on Ubuntu.

Honestly, that might be because of how Electron renders content. That CPU usage isn’t super high but I don’t think Joplin uses hardware accelerated rendering from the GPU like some apps are starting to now. I do know that there was a new renderer released for mobile platforms pretty recently but I’m not sure if it affects Desktop or not.

I can confirm this on Debian Testing, Joplin cpu use is between %65 to %80 during scrolling.

I use Firefox 72.0.2 (64-bit), but I cannot easily confirm that since I have tons of tabs open and some extensions as well, so the situation between the two softwares (Joplin and Firefox) are not similar. Regardless I tested it and on an HTML that was produced based on RMarkdown (some images and text, but no crazy ajax or background JS), I get about 68% cpu usage for each thread.

Well, it depends on what is your threshold for “super high”, but based on the hardware I have, a good portion of my CPU power goes to scrolling in a plain text of one app (you can see it on the screenshot as well), meaning that I cannot have other softwares running smoothly if they need some good CPU power.

This is my CPU model:

Intel® Core™ i5-7200U CPU @ 2.50GHz

I was going by what the gif showed. It didn't go above 55% or so but for my system, that would be more like 80% in that context. Haha

Old i2 here. :laughing:

1 Like

At application level, not much is happening when scrolling, and I’m not seeing this on macOS for instance, so it’s possible it’s some Linux and/or Electron issue.

I watched the GIF I posted and I though it worth mentioning that:

  1. The software I used to record (peek) the screen also use CPU a lot, so the barplots you see at the top part of terminal are mostly dominated by that software
  2. in the htop command, I’ve filtered joplin, meaning it only shows processes that have “joplin” in their names/commands.
  3. the table is sorted by CPU usage in decreasing order

So just pay attention to the table and the first three rows.

What would be your suggestion to be done? Is there any way to report this to correct channels (Electron or AppImage or …)?

I’d post in the official issue tracker for Electron for starters. Below is a link to all current open issues related to CPU and Linux but there may be closed ones related too.

1 Like

Indeed it doesn’t harm to try to post on the Electron bug tracker, but I wouldn’t be very hopeful it would be fixed as they would need a minimum example to test with. As it is, they can simply assume it’s an issue with Joplin (which I don’t think it is but it’s hard to be 100% sure) and in any case, it’s unlikely they’ll try to build Joplin just to test this.

With a bit of luck it’s one of those performance issue that gets resolved in a future version though. I remember not long ago that they are making some changes to better use the multi-process architecture of Chromium so that could help.

1 Like

Just like with many other libraries, though, Electron and Chromium are both a bit slow on fixing bugs on and pushing updates to the Linux platform.

The issue persist in 1.0.193

I don’t know what is the best way to report (the posts here cannot be edited later). I thought it would be productive and informative if I report if the situation is resolved in every release of Joplin. But at the same time I do not want to spam everyone. I’m all ears if you:

  1. know a better way to report this
  2. think that there is no point in such reporting

As this is most likely an Electron issue, the latest versions indeed won’t change much since we didn’t upgrade Electron yet. We’ll probably do it at some point in the coming months and hopefully it will fix the issue.

Since in the new version of Joplin the Electron version has been updated (“Improved: Upgraded to Electron 8.2.5”), I tested this again.

Unfortunately, I have to report that the issue persists in version 1.0.216. I don’t have access to the same machine (the current one is has much higher specs), so I got this from Activity Monitor with some baseline CPU usage for about 100 seconds and then scrolling for 20 seconds to show the effect:

The following is the details of the Joplin I tested:

Joplin 1.0.216 (prod, linux)

Client ID: 2f9120d318dd49e7889b65150fa0fbeb
Sync Version: 1
Profile Version: 29

Revision: 4eb680d (master)