mugiwara85 / CodeblockCustomizer

Codeblock Customizer plugin for Obsidian
MIT License
147 stars 7 forks source link

[BUG] Performance Degradation With Combination of Long Notes, Several Themes, Split Panes #68

Closed jeffchiou closed 4 months ago

jeffchiou commented 6 months ago

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)

  1. Create a new vault
  2. Create a very long markdown file. See example: markdown-tester.md. Can also copy-paste to make it longer.
  3. IMPORTANT: Split the pane or drag a new file to split the window.
  4. Show that performance is not degraded by highlighting lots of text quickly using the mouse.
  5. Install Minimal Theme
  6. Show that performance is not degraded by highlighting lots of text quickly again.
  7. Install Codeblock Customizer and enable.
  8. Performance should suffer when highlighting lots of text quickly with the mouse.

Extra details

  1. Disable Codeblock Customizer
  2. Performance should return to normal when highlighting lots of text quickly with the mouse.
  3. Re-enable Codeblock Customizer. See the degraded performance again.
  4. Un-split (close) the panes.
  5. Performance should return to normal.

Some notes

Some things I'm not sure of

jeffchiou commented 6 months ago

After some more investigation it might be related to either CodeBlockHighlight.ts or the 3rd-party library pickr with moveable.js

mugiwara85 commented 6 months ago

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.

jeffchiou commented 6 months ago

No problem, I totally understand, and appreciate you working on a free open-source project!

mugiwara85 commented 4 months ago

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.

mugiwara85 commented 4 months ago

I just released a new version. Could you please recheck if the problem still persists or is it solved now? Thanks in advance!

jeffchiou commented 4 months ago

Hi @mugiwara85, I did some quick testing and performance with split panes + Minimal Theme seems much improved! Thank you for your time and effort!

mugiwara85 commented 4 months ago

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.