[BUG] Performance Degradation With Combination of Long Notes, Several Themes, Split Panes
Closed this issue · 7 comments
Overview
When using split panes, long notes, and some themes, responsiveness and performance degrades. This is most prominent with the Minimal/Things/Sanctum themes.
I figured this bug would be important because these themes are popular. I really like Codeblock Customizer but it's preventing me from using it since I use split panes frequently.
Reproduction
Took me forever to diagnose this and also make this reproducible on my computer. I'm running this on Windows 11, Obsidian 1.5.2
(might require a slower computer)
- Create a new vault
- Create a very long markdown file. See example:
markdown-tester.md. Can also copy-paste to make it longer. - IMPORTANT: Split the pane or drag a new file to split the window.
- Show that performance is not degraded by highlighting lots of text quickly using the mouse.
- Install Minimal Theme
- Show that performance is not degraded by highlighting lots of text quickly again.
- Install Codeblock Customizer and enable.
- Performance should suffer when highlighting lots of text quickly with the mouse.
Extra details
- Disable Codeblock Customizer
- Performance should return to normal when highlighting lots of text quickly with the mouse.
- Re-enable Codeblock Customizer. See the degraded performance again.
- Un-split (close) the panes.
- Performance should return to normal.
Some notes
- I tried some other themes, performance seemed slightly worse but I couldn't tell as much, unlike with Minimal/Things/Sanctum themes.
- Doing some inspector performance profiling, it seems to be related to events (i.e. keydown, mousedown)
- Related to various updating functions in the app and maybe recalculating style.
- No errors in console
- Other plugins don't seem to have this problem with the themes
- Disabling all settings in codeblock customizer doesn't seem to affect the performance issues.
Some things I'm not sure of
- If it's a computer hardware or software-specific bug. Haven't tested it on another computer.
- One time when toggling minimal theme and codeblock customizer, performance returned to normal with both on. I have no idea why and cannot reproduce it. May be remembering incorrectly.
After some more investigation it might be related to either CodeBlockHighlight.ts or the 3rd-party library pickr with moveable.js
Thanks for you detailed review. Unfortunately, in the last few weeks I was very busy, but I will definitely check out all open problems, and try to solve them during the holidays. I might get back to you, if I am having trouble reproducing something.
No problem, I totally understand, and appreciate you working on a free open-source project!
Just a heads up: I found two things, one in edit mode and multiple in css, which had an effect on performance. I will modify the css so it doesn't cause any problems. After that I will release the new version.
I just released a new version. Could you please recheck if the problem still persists or is it solved now? Thanks in advance!
Hi @mugiwara85, I did some quick testing and performance with split panes + Minimal Theme seems much improved! Thank you for your time and effort!
Hi @jeffchiou no problem. It was actually caused by 2-3 CSS selectors. There is still a little bug with split panes. I am working on It now.