Skip to content
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

Bug: performance issues #91

Open
olearydj opened this issue Aug 17, 2023 · 40 comments
Open

Bug: performance issues #91

olearydj opened this issue Aug 17, 2023 · 40 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed High Priority High Priority issues needs info More information is required needs repro Needs reproduction

Comments

@olearydj
Copy link

While Code Styler is enabled my Obsidian performance is significantly affected. Keyboard response, file opening, etc. are all noticeably delayed. When I disable OCS, these symptoms go away.

Describe the bug

See above.

Steps to reproduce

See above.

n/a

Expected behaviour

Don't hinder app responsiveness.

Current behaviour

Distracting enough that I have to disable an otherwise awesome plugin. ☹️

Environment

  • Plugin Version: 1.0.7
  • Obsidian Version: 1.4.3 / 1.3.5 installer
  • Platform: desktop
  • OS: macos 13.4.1(c)
  • Theme: minimal
  • CSS Snippets: a few simple ones (4) plus what is automatically generated by supercharged links plugin

16" 2019 MacBook Pro with 2.3g 8-core intel and AMD radeon pro 5500m (8gb); 32gb ram
I've never reported a performance bug before, so I'm not one of those guys.

Additional context

No console errors.
I'm happy to provide any other logs / data you need to consider / address this issue.
Thanks for a great, beautiful plugin.

Dan

@olearydj olearydj added the bug Something isn't working label Aug 17, 2023
@mayurankv
Copy link
Owner

Sorry, is version 1.4.3 an insider version?

Have you used any version of the plugin before 1.0.7? Were the issues still present?
Could you try making a new vault and seeing if the performance persists? If it does, I'd still be interested in solving why its affecting performance for you but It'd be nice to know the whole thing isn't buggy haha.

Lastly, if the problem does persist, could you try close all notes apart from one reading mode note and see if the symptoms are still there, and also then separately try just one editing mode note and see if the symptoms remain.

Did you try and disable all other plugins than this plugin? (I know that's tedious so no worries if not).

@mayurankv mayurankv added needs repro Needs reproduction needs info More information is required labels Aug 17, 2023
@olearydj
Copy link
Author

It seems ok in a sandbox with just OCS installed.

I previously reported a couple of bugs that you fixed in earlier versions. I've experienced "laggy" performance from the first use, but wasn't certain it was due to OCS. I've enabled and disabled it several times since, each time sensing the issue enough to disable it again. It is not a dramatic slowdown, but enough to be distracting.
v1.4.3 is an insider version.

I recorded a test in my main vault. First I closed all notes, restarted Obsidian, and then started recording the video.
https://share.cleanshot.com/3FPHdpQW

Maybe a result of interaction with other plugins, etc. Can I dump any performance related data for you?
I can do more testing with some plugins deactivated, etc. later but don't have the time right now.

Thanks for the quick support as always.

@mayurankv
Copy link
Owner

Huh, I'm afraid I'm going to have to take some time working out what the issue could be. I'll first try to replicate it if possible. Will likely ask a few questions over the next few days.

@mayurankv
Copy link
Owner

Honestly, that is really surprising, I've not noticed any effects similar to that video. Do the symptoms also occur in reading mode?

@olearydj
Copy link
Author

Sorry for the troubling news.
It is hard to tell if the effects persist in reading mode, because it is most noticeable when I type, etc.

But when checking to confirm that I noticed that my code blocks aren't actually getting the OCS styling in reading mode. This must be a new problem as I would have noticed it before. I've attached a new video that shows that. Also, when I deactivate OCS, the live preview mode gets corrupted. See video.

https://share.cleanshot.com/V1Yx9wm5

@mayurankv
Copy link
Owner

Thanks again for the detailed report. I had actually noticed when doing extensive testing that sometimes half the page would load before I scrolled and then the rest would suddenly appear so I agree there must be some significant internal issue regarding that. For the reading mode, are you definitely not getting error outputs in your command log?

@olearydj
Copy link
Author

I just repeated the entire process in the prior video with the dev tools opened. No errors or warnings were popped.

@olearydj
Copy link
Author

I also noticed the text / styles popping in while scrolling in Reading mode with OCS active.

@mayurankv
Copy link
Owner

mayurankv commented Aug 18, 2023

Would it be possible to list the active plugins you're using?

I must say I'm at a bit of a loss on where to start with this. I'll try and identify why things may not completely render instantly with reading mode for some clues. Also editing mode may just be running a bit too intensively causing the performance issues. But reading mode not applying at all with no errors at all is weird.

@mayurankv
Copy link
Owner

Could you send me the content of the note that breaks as well?

@olearydj
Copy link
Author

Happy to provide whatever you need.

python-virtual-environments.md

SYSTEM INFO:
	Obsidian version: v1.4.3
	Installer version: v1.3.5
	Operating system: Darwin Kernel Version 22.5.0: Thu Jun  8 22:22:22 PDT 2023; root:xnu-8796.121.3~7/RELEASE_X86_64 22.5.0
	Login status: logged in
	Catalyst license: vip
	Insider build toggle: on
	Live preview: on
	Legacy editor: off
	Base theme: dark
	Community theme: Minimal v7.2.0
	Snippets enabled: 5
	Restricted mode: off
	Plugins installed: 49
	Plugins enabled: 41
		1: Dataview v0.5.56
		2: File Tree Alternative Plugin v2.3.5
		3: Admonition v10.0.1
		4: Auto Link Title v1.4.1
		5: Advanced Tables v0.19.1
		6: Better Word Count v0.10.0
		7: Advanced Slides v1.20.0
		8: Divide & Conquer v1.0.0
		9: floating toc v2.3.0
		10: File Creation and Last Modified Timestamps in Status Bar v1.2.0
		11: Another Quick Switcher v8.14.0
		12: Zotero Integration v3.0.7
		13: Pandoc Reference List v2.0.19
		14: Hide Sidebars on Window Resize v1.1.0
		15: Plugin Update Tracker v1.5.2
		16: Share as Gist v1.2.1
		17: Text Format v2.2.7
		18: Wikipedia v1.0.3
		19: Hider v1.3.1
		20: Hotkey Helper v0.3.18
		21: Kanban v1.5.3
		22: Linter v1.19.1
		23: Longform v2.0.3
		24: Minimal Theme Settings v7.2.1
		25: Note Refactor v1.7.1
		26: Pandoc Plugin v0.4.1
		27: Pane Relief v0.5.1
		28: Quick Explorer v0.2.8
		29: Readwise Official v2.0.1
		30: Recent Files v1.3.7
		31: Regex Find/Replace v1.2.0
		32: Settings Search v1.3.8
		33: Sortable v0.3.1
		34: Style Settings v1.0.6
		35: Supercharged Links v0.10.0
		36: Tag Wrangler v0.5.11
		37: Templater v1.16.0
		38: Text Generator v0.3.20
		39: Force note view mode v1.2.0
		40: Obsidian Git v2.20.7
		41: Default New Tab Page v0.11.0

RECOMMENDATIONS:
	Custom theme and snippets: for cosmetic issues, please first try updating your theme and disabling your snippets. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community theme and snippets.
	Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.

@olearydj
Copy link
Author

It's a lot of plugins. I can do some divide and conquer testing this weekend if you like. It might not completely isolate the problem but could save a lot of time.

@mayurankv
Copy link
Owner

mayurankv commented Aug 20, 2023

That would be very helpful if you get the time! I'm trying to get the next release done and then I'll try and focus on this. Thank you for all the info!

@mayurankv
Copy link
Owner

I doubt this has been resolved with the latest release?

@olearydj
Copy link
Author

I haven't had a chance to check it yet. Will do so this weekend and provide some divide and conquer findings if not. Sorry for going quiet - I'm trying to finish my PhD this semester while teaching a full load and had to travel last weekend.

@mayurankv
Copy link
Owner

Oh no rush at all! Best of luck with the PhD and teaching!

@mayurankv
Copy link
Owner

FYI some rather large changes have been made to how the live preview part of the plugin works with the last two versions. Though I'm not actually sure whether it improves or detracts from performance (as I've never had an issue with it either way). Would be interested to hear how you feel when you get the chance!

@olearydj
Copy link
Author

Hey, I'm really sorry I haven't been able to get back to this. It is still on my list and I plan to this weekend.
Meanwhile I've noticed the latest version fails to install when upgrading in the plugin panel.

@mayurankv
Copy link
Owner

Hi, honestly no worries at all! I actually just released a new version and tested that I could update from a previous version. Not sure if the last release had issues. Could you check if this one works?

@olearydj
Copy link
Author

olearydj commented Sep 1, 2023 via email

@github-actions github-actions bot added the Stale label Nov 1, 2023
@noidilin
Copy link

Hi, I'm experiencing a similar performance issue. Most of the operations in Obsidian feel laggy after OCS is enabled.

I've tried disabling the plugins I am using one by one and found out that disabling the "Excalidraw" plugin will fix the performance issue in my case. It's worth mentioning that before installing OCS, I hadn't noticed any kind of performance issue while using the "Excalidraw" plugin.

Here is the system info when encountering the issue:

Plugin Version: 1.0.11

{
  "process": {
    "obsidian-version": "1.4.16",
    "obsidian-installer": "1.4.13",
    "platform": "desktop",
    "os": "windows11",
    "theme": "minimal"
  },
  "app": {
    "internalPlugins": {
      "config": {
        "file-explorer": true,
        "global-search": true,
        "switcher": true,
        "graph": true,
        "backlink": true,
        "outgoing-link": true,
        "tag-pane": true,
        "page-preview": true,
        "daily-notes": false,
        "templates": false,
        "note-composer": false,
        "command-palette": true,
        "slash-command": false,
        "editor-status": false,
        "starred": true,
        "markdown-importer": false,
        "zk-prefixer": false,
        "random-note": false,
        "outline": true,
        "word-count": false,
        "slides": false,
        "audio-recorder": false,
        "workspaces": true,
        "file-recovery": true,
        "publish": false,
        "sync": false,
        "canvas": true,
        "bookmarks": true,
        "properties": true
      }
    },
    "plugins": {
      "enabledPlugins": [
        "smart-random-note",
        "note-refactor-obsidian",
        "hotkeysplus-obsidian",
        "better-word-count",
        "periodic-notes",
        "table-editor-obsidian",
        "cm-typewriter-scroll-obsidian",
        "tag-wrangler",
        "dataview",
        "obsidian-outliner",
        "obsidian-style-settings",
        "templater-obsidian",
        "obsidian-git",
        "calendar",
        "obsidian-admonition",
        "obsidian-minimal-settings",
        "obsidian-hider",
        "obsidian-footnotes",
        "open-vscode",
        "obsidian-linter",
        "metadata-menu",
        "tag-navigator",
        "obsidian-contextual-typography",
        "obsidian-memos",
        "obsidian-advanced-slides",
        "obsidian-regex-pipeline",
        "excalibrain",
        "various-complements",
        "darlal-switcher-plus",
        "cm-chs-patch",
        "omnisearch",
        "obsidian-hover-editor",
        "obsidian-filename-heading-sync",
        "pane-relief",
        "nldates-obsidian",
        "url-into-selection",
        "workspaces-plus",
        "obsidian-icon-folder",
        "obsidian-paste-png-to-jpeg",
        "obsidian-snippet-downloader",
        "obsidian-quiet-outline",
        "obsidian-textgenerator-plugin",
        "obsidian42-brat",
        "yank-highlight",
        "obsidian-plugin-prettier",
        "code-emitter",
        "graph-analysis",
        "ninja-cursor",
        "easy-typing-obsidian",
        "code-styler",
        "obsidian-excalidraw-plugin"
      ]
  }
}

@github-actions github-actions bot removed the Stale label Nov 23, 2023
Repository owner deleted a comment from github-actions bot Nov 26, 2023
@mayurankv
Copy link
Owner

Hi! Thanks for letting me know. That's really annoying. Just to double check, if you update to the new release the issue still persists right? One more question, does the issue still persist in a new vault with just Excalidraw and OCS installed?

@mayurankv
Copy link
Owner

@olearydj Just to check, are you still having any performance issues at all? No worries if you haven't got any further info.

@mayurankv mayurankv added help wanted Extra attention is needed High Priority High Priority issues labels Nov 26, 2023
@noidilin
Copy link

I just tested in a vault with a clean setup, and both the “Excalidraw” and OCS plugins are updated. Unfortunately, I found out that actually Obsidian became pretty laggy after I enabled the “Excalidraw” plugin. Since I haven’t used a brand new vault for a long time, I didn’t notice the performance impact before.

Moreover, by enabling more plugins that function in edit mode, the performance drop is continuously increasing. Therefore, the experience that I am having might be the compound result of multiple plugins, but most of it is contributed by “Excalidraw” and then secondly by the OCS plugin.

@mayurankv
Copy link
Owner

I'm always interested in performance issues so I will try and have a look as to how any issues might be arising.

Does enabling OCS after exalidraw affect performance any more than any other plugin after excalidraw? i.e. the execute code plugin or dataview or any others?

@noidilin
Copy link

It is quite hard to explain the laggy behavior, so I recorded a video with the newly created vault and other plugin enabled. There is a keycast indicator showing what key I have pressed or I am currently holding.

2023-11-27.22-36-47.mp4

During this video, I have done these operation:

  1. Use arrow key to move in source mode with OCS and excalidraw disabled.
  2. Enable Excalidraw. You can see the cursor behavior not syncing with keypress (especially when I holding arrow key).
  3. Disable Excalidraw and reload obsidian.
  4. Enable OCS and the cursor behavior still not syncing with keypress.
  5. Enable Excalidraw with OCS enabled. The issue become more noticable.

In my personal experience, most significant performance impact comes from the OCS and Excalidraw plug-ins.

@roman-balzer
Copy link

I did some testing on this, so I had an empty file where I had a macro type like 20 characters (almost no delay between).
No plugins except OCS, toggling on/off Theme and CSS

Results:
Using OCS will introduce severe typing lag especially with multiple CSS-Snippets like MCL or some of my custom ones. However, this happens when I have a "more complex" file open.
Empty file with no sidebar - no lag
Empty file with complex file in sidebar - severe lag (800ms)
Complex file with no sidebar - severe lag (800ms)

When I say "complex", I'm talking about some headers, some task lists and some links. Not more than that. And at no point in those tests I had somewhere a code snippet in view or file.

@mayurankv
Copy link
Owner

Hi, thanks so much for this, it'd be great to tackle this. Would it be possible for you to provide some of the snippets and files for which the lag was noticeable?

@roman-balzer
Copy link

I'm still trying to narrow it even more down, since the CSS also does introduce a good amount of lag. But like I mentioned even with no CSS and no Theme, the rendering goes from ~70ms to ~115ms in my tests.

As for CSS, MCL's CSS had a really noticeable effect on the rendering performance alongside OCS. As for the file, I'd rather not share my private ToDo list, but like I said, it's really just a File with Headers, TasksList, some links internal and external, maybe 80-100 lines.

@mayurankv
Copy link
Owner

No worries, I'll try and create a similar file and see if I can reproduce this. Thanks for mentioning the CSS and any further information you do fine would definitely be helpful in fixing this. This will probably be my first priority to fix if I can reproduce it (hopefully over the next few days). By any change are the css files that get cumbersome ones that define colours? Also one more question, how are you measuring the rendering time? That would be really helpful for me to test as well!

@roman-balzer
Copy link

I measured the time with dev tools.
image
I mostly only looked at Recalculate Style as that did notable jump from 50ms to 800ms. But I do have to add, since I tested it with a macro without delay between keypresses, that made the performance issue more obvious and thus those 800ms. When mashing 123123123123 fast, those numbers where not that high, but still very notable elevated.

About the problematic CSS, I haven't narrowed it down, also not really a pro on CSS performance. But I'll just add that info, some of more notable slowdowns occurred with CSS files using :has() and :is(). But that's just a wild guess.

@mayurankv
Copy link
Owner

Thanks for the added detail. Would it be possible to share the macro as I'd obviously like to fix this issue as completely as possible (though an imperceptible lag would still be much better than the current state).

@roman-balzer
Copy link

Macro is just in my keyboard software writing, 123 123 123 this is a test. Can't export that.

@mayurankv
Copy link
Owner

Got it cheers, thanks for all th info, will try to reproduce.

@mayurankv
Copy link
Owner

I'm currently updating the plugin with a large refactor. If there's anyone who's experienced this issue happy to test it, please let me know!

@BradXiao
Copy link

FYI
In my case, I observed a obvious performance drop from version v1.6.7 to v1.7.*. (desktop, Windows).
There is a note in the changelog. Perhaps that's the reason.

@charleshan
Copy link

Good to see that this is being worked on. I had to disable the plugin because it created a noticeable lag whenever I type or select text

@mayurankv
Copy link
Owner

Absolutely no worries if not, but if you could, would you be happy to locally download the refactor branch and check that the issue is no longer present there? It's nearly got feature parity but highlighting is being a faff and also there's some other small issues but would be good to test!

@galligan
Copy link

Really like how nice things look with the plugin, but unfortunately I ran into significant performance issues. I did a lot of performance profiling and went plugin-by-plugin to see if I would see any meaningful improvements by turning them off. Unfortuantely the biggest culprit happens to be Code Styler. It easily increased my rendering type on typing by 400%.

I'd be good with an option within code styler that only renders the nicer view in preview mode. That might be a reasonable compromise until the refactor is in!

@BradXiao
Copy link

BradXiao commented Feb 20, 2025

Absolutely no worries if not, but if you could, would you be happy to locally download the refactor branch and check that the issue is no longer present there? It's nearly got feature parity but highlighting is being a faff and also there's some other small issues but would be good to test!

FYI
I installed the refactor branch version and used Obsidian v1.8.3. (desktop, Windows).
The performance was a lot worse.
My solution for now is to use older version of Obsidian (v1.6.7).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed High Priority High Priority issues needs info More information is required needs repro Needs reproduction
Projects
None yet
Development

No branches or pull requests

7 participants