Swapping to "1. Welcome to Joplin" in "Welcome! (Desktop)" from within notebook took 87ms.
Swapping to "1. Welcome to Joplin" in "Welcome! (Desktop)" from a different notebook (not within the same parent folder either) took 420ms ( )
Joplin 2.6.10 (prod, linux)
Revision: 98fba37
OS: Linux Mint 20.3 x86_64
Host: MS-7B85 1.0
Kernel: 5.4.0-96-generic
DE: Cinnamon
WM: Mutter (Muffin)
CPU: AMD Ryzen 5 3600X (12) @ 3.800G
GPU: AMD ATI Radeon RX 5600 OEM/5600
Memory: 3990MiB / 16019MiB
To make the differences clear, I measured the performance without plugins in my PC.
Switching to "1. Welcome to Joplin" :
Condition
From the same notebook
From a different notebook
Remarks
no plugin
237 msec
998 msec
New results
many plugins
916 msec
2782 msec
Measured before
The CPU performances of mine and Daeraxa's PC are as follows. Since most of the elapsed time is script execution, the performance depends on a CPU. Therefore, the differences (237ms & 998 ms vs 87ms & 420ms) seem to be reasonable.
CPU
CPU Mark
Remarks
Core i5-4670
5403
ken1kob's
AMD Ryzen 5 3600X
18295
Daeraxa's
From the results, here's what I can say.
PC performance often varies several times, so just because it's comfortable for someone doesn't mean it's the same for everyone.
@ken1kob, any chance you could also check the performance with only the Outline plugin, and only the Tab plugin? Those two plugins don't need to do any big processing in the background, so I'm wondering if they can be improved, or if it's a major performance issue with the app itself.
I know you have this PR about optimising the view parameter, which could indeed be part of the reason for the poor performance.
Those two plugins don't need to do any big processing in the background, so I'm wondering if they can be improved, or if it's a major performance issue with the app itself.
When I read their codes, there were little major performance problems. (There were some rooms for optimization, such as memoizing API calls. But, they were not significant.)
Maybe, the problem is in Joplin. While I measured the performance in these days, I noticed that the performance degradation depends not on specific plugins but on the type of plugins. Concretely, for each plugin with a panel using onNoteChange() / onNoteSelectionChange() is used, some overhead (ex. 300msec in my PC) will be added.
Note Tabs and Outline are in the type. Maybe, Note Link System plugin is also the same.
I know you have this PR about optimising the view parameter, which could indeed be part of the reason for the poor performance.
I have the same opinion. I make a hypothesis that the update of the html property of a plugin panel may happens to re-render the whole app, because all components depend on the property. Its overview is here.
To further investigate the hypothesis, I measured the performance in Joplin 2.7.10 which PR #5770 is applied to. The results are as below.
Switching to "1. Welcome to Joplin" :
Condition
From the same notebook
From a different notebook
Remarks
only Outline plugin + PR #5770
184ms
-
new result
only Note Tabs plugin + PR #5770
190ms
-
new result
no plugin + PR #5770
154 msec
365 msec
new result
many plugins* + PR #5770
258 msec
1517 msec
new result * see above
Since PR #5770 removes unnecessary dependencies between html property and many components, unnecessary re-rendering is reduced. It seems that overhead originated from plugin panels are drastically reduced.
Your exhaustive results endorse our previous experiments and hypothesis.
Honestly speaking, I'm surprised that your PC is relatively slow, since you wrote "fluently". In such a case, I might feel sluggish rather than fluent. It is interesting that various impressions on UX co-exists.
I work remotely from HO for nearly two years now, so I might gotten used to slow changes of applications or windows. On the other hand, my typical use case for Joplin is working on one note - perhaps in a longer text - then switching to a different application and then perhaps return to Joplin for creating a new note or searching an existing one. I can imagine that switching from note to note is not such regular operation for me in contrast to others.
And I use Joplin portable on an bitlock-encrypted USB-stick as well. So I have a different perception of sluggishness definitly
When a note is switched, its elapsed time depends where to click to trigger switching. For example, if you switch a note by clicking Sidebar, it takes longer time. If you switch a note by clicking NoteList, it takes shorter time. The measurements are here:
Condition
Where to click
Switching to "1. Welcome to Joplin" from a different notebook
many plugins
NoteList
1153 msec
many plugins
Note Tabs plugin
1839 msec
many plugins
Sidebar
2782 msec
I analyzed the causes of the differences.
The difference between NoteList and Note Tabs plugin is the overhead of a plugin decribed before and other unidentified overhead.
As you notice, the overhead of Sidebar is significant. The most of the overhead is unmounting and mounting NoteEditor. When a notebook in the Sidebar is clicked, for a only moment, no note is selected, and NoteEditor is unmounted. After that, a note in a new notebook is selected, and NoteEditor is mounted again. Since mounting NoteEditor involves heavy operations such as loading large javascript modules (ex. mermaid.min.js), it takes long time.
Not sure if it helps but interestingly enough it doesn't seem to be happening when selecting the notebook from a note in a search result. In other words, the time of opening the notebook in the searched note (the same note is focused as a result) is on par with "switching to a note from the same notebook".
UPD: I rechecked it, and it seems the time of opening the notebook in the searched note is 1,5x higher than "switching to a note from the same notebook". So, on par with note tab way of switching notes I guess
@ken1kob, regarding the test case "switch to a note from different notebook", do you include or exclude from the timing the "Evaluate script" task at the end of note switch?
I'm currently testing a few pieces of hardware available to me. It's a WIP but if you would like to add some parameters to keep track, I can do that. So far, I'm tracking only the following:
My app is also noticeably slow, even on an M1 mac. I use a lot of plugins though, so I just assumed it was that and ignore it as much as I can. I got a crash when trying to profile, so not able to add specific numbers, but one thing I noticed is that the app logs 60+ messages to console every time i change notes and 90+ when changing notebook. Is it possible that logging is slowing things down? Or is that trivial/normal? I will try to get some better profiling info.
It is slow on a Linux laptop with 2 cores (Intel GPU) + SSHD. Sync pretty much takes down the whole computer for minutes. This is my second laptop with similar specs, and I had the same speed issue with the previous one. I do not use a lot of plugins.
The word of warning: the chart mushes all test states together and doesn't account for multiple entries of the same state. So if you want to look at the good data, make your own chart out of the source.