-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Desktop: Note switching time is too slow #6386
Comments
Performance bottleneck analysisI analyzed performance bottlenecks of Joplin UI. Current findings from the discourse topic and my analysis are as follows.
These details will be described in later posts, specific issues, or upcoming PRs. Performance measurementTo measure note switching time, Performance Analyzer of Electron is used.
The measurement procedure is described in this discourse post. |
The two performance bugs (#6394 and #6416) are close to being solved. The next is to solve performance bottlenecks in this issue. @laurent22, shall I make a large PR packaging several optimizations or several PRs per a single optimization? Which way would you prefer? |
Yes, a single optimisation per pull request please, it makes it much easier to review. |
About inefficient props updateIn React, props and states are used to decide which components are needed to be updated. So, setting props should be sufficiently fast. PR #6437 resolves these bottlenecks. Its detail is there. |
But WhenClause expression parsing is already cached I believe? The rest is constructing a key/value dictionary which I assume is not that slow. |
Partially yes, but no in totality. |
If parsing advanced expressions is what takes time then that's what we should be cached. I probably won't merge that WhenClause pull request for now, and if there are optimisations to make I might make them. |
Only caching AdvancedExpression instances is not enough. Caching WhenClause instances is needed. The reason is written below.
Honestly speaking, the current WhenClause has a performance BUG. BTW, creating and copying WhenCaluseContext instances are also heavy. So, they also worth being adopted. |
About redundant re-rendering (false positive updates#1)In React, the changes of useState variables always involve re-rendering of components. If unnecessary useState variables are used, they may cause redundant re-rendering. PR #6443 suppresses such redundant re-rendering in Markdown Editor/Viewer. |
About redundant rerendering (false positive dependencies#1)In React, if unnecessary props or states are described, redundant rerendering may occur. The following PRs fix such unnecessary dependencies in MainScreen component to reduce rerendering. |
Performance comparison#1The below shows comparisons among a version before-improved, a version with two performance bug fix PRs (#6394,#6416) and a version with the two fix PRs and four improvement PRs (#6437,#6443,#6444,#6446) up to this point.
|
About redundant re-rendering (false positive updates#2)When a notebook is switched using Sidebar, for example, in the Performance Analyzer image (A) in this PR #6451, it is strange that Sidebar is re-rendered three times. In this case, data used for Sidebar don't change so many times, and the number of re-rendering should be less. PR #6451 reduces such redundant and costly re-rendering in Sidebar. |
About inefficient Electron API useSome of native Electron APIs have a large overhead to issue. During note switching, frequent uses of Electron's MenuBar's APIs in a short term cause a performance problem. PR #6464 fixes the problem and reduces the time to handle the MenuBar. |
About factors proportional to note lengthA longer note takes longer time. The followings factors are proportional to note length. And if they become more efficient, the paybacks are greater with note length.
However, for (A) and (B), at this point, there are only non-significant improvements. So, no PR will be made in this issue. |
About redundant re-rendering (false positive updates#3)PR #6469 suppresses redundant re-rendering of NoteEditor caused by ResourceInfos and redundant loading of ResourceInfos. |
About redundant re-rendering (false positive updates#4)PR #6470 reduces redundant re-rendering in NoteEditor when |
About redundant re-rendering (false positive dependencies#2)PR #6471 fixes some false positive dependencies. They are trivial but have not small impacts. |
Performance comparison#2The below shows comparisons among a version before-improved, a version with two performance bug fix PRs, a version with the two and the previous four improvement PRs, and a version with the more additional five improvement PRs (#6451, #6464, #6469, #6450 and #6451).
It shows the final performance is about 2-4 times faster than the performance before this issue. |
ResultThe below chart shows where the performances of the reference PC (Core i5-4670, CPU Mark=5403, Win10) are in the groups of collected PC performance data (white circles). Simultaneously, it shows where their improved performances (black stars) respectively. According to the chart, it can be estimated that most PCs will have acceptable performance (less than 1 sec response) by applying the PRs in this issue. In conclusion, it can be said that the goal of the issue, "For many users' PCs, note switching time becomes less than 1 sec" has become fulfilled. |
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? If you require support or are requesting an enhancement or feature then please create a topic on the Joplin forum. This issue may be closed if no further activity occurs. You may comment on the issue and I will leave it open. Thank you for your contributions. |
Updated the labels |
As reported in the topic of discourse, some people are suffering from Joplin's UI performance. Since the specs of PCs are in a very wide range (5x), not all people feel UX response is comfortable. In actually, some people forgo using plugins to mitigate UI performance problems.
This issue focuses on one of the key UI performance aspects, note switching time. The following chart is the summary of the collection of many people's reports in the topic (thanks!). It shows that note switching time is over 1 sec in not a little range of PCs. Especially, it is found that note switching between different notebooks takes over 1.5 sec even for fast PCs, if some plugins are used.
What is expected
For many users' PCs, note switching time becomes less than 1 sec. Because it is often said that "1.0 second is about the limit for the user's flow of thought to stay uninterrupted".
Note:
Environment
The text was updated successfully, but these errors were encountered: