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):
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 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.
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:
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
in the htop command, I’ve filtered joplin, meaning it only shows processes that have “joplin” in their names/commands.
the table is sorted by CPU usage in decreasing order
So just pay attention to the table and the first three rows.
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.
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.
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:
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: