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

unnecessarily high CPU acceleration due to third party dependency #175

Open
GottZ opened this issue Jul 24, 2024 · 5 comments
Open

unnecessarily high CPU acceleration due to third party dependency #175

GottZ opened this issue Jul 24, 2024 · 5 comments

Comments

@GottZ
Copy link
Contributor

GottZ commented Jul 24, 2024

Describe the bug
unnecessary cpu acceleration through a third-party plugin

To Reproduce
Steps to reproduce the behavior:

  1. enable the plugin
  2. cold start obsidian
  3. open task manager and wait for obsidian to settle down
  4. open obsidian debug tools via ctrl + shift + i and gather performance metrics

Expected behavior
0% cpu usage

Screenshots
Obsidian without obsidian-editing-toolbar:
image
Obsidian with obsidian-editing-toolbar:
image
burn-down of performance metrics:
image
cause, as identified by metrics:
image

Desktop (please complete the following information):

  • OS: Windows 11
  • Plugin Version: 2.4.16

Additional context
I could pin down the issue to this code:
https://github.com/simonwep/pickr/blob/39b4d82068578c306714570a24cb0ab470ffb154/src/js/pickr.js#L147-L173
there once was a related pull request:
simonwep/pickr#233
please try to use this library in a way, where it doesn't cause a infinite loop.

@ITMighty
Copy link

For the last month or so I've been experiencing sluggish performance with Obsidian. I finally narrowed it down to this plugin. Unlike @GottZ, I don't know what or how to fix it, but any number of plugins can be enabled with seemingly no performance hit to Obsidian. Once this plugin is enabled, however, all hell breaks loose. It can get so bad I can type a whole sentence into a note before it appears on screen.

@GottZ
Copy link
Contributor Author

GottZ commented Aug 22, 2024

image
this is how I actually fixed it for myself. it just reduces calling this on every animation frame to every 5 seconds.
I don't know why it's required or why it fails since I didn't dig into pickr yet, but in case you want an easy replacement for .obsidian/plugins/editing-toolbar/main.js, just diff the following against your main.js, to ensure I did not inject anything malitious: main.zip

cc @ITMighty

@zanodor
Copy link

zanodor commented Sep 17, 2024

image this is how I actually fixed it for myself. it just reduces calling this on every animation frame to every 5 seconds. I don't know why it's required or why it fails since I didn't dig into pickr yet, but in case you want an easy replacement for .obsidian/plugins/editing-toolbar/main.js, just diff the following against your main.js, to ensure I did not inject anything malitious: main.zip

cc @ITMighty

Gott-Sent!
Vielen dank,

Z.

@GottZ
Copy link
Contributor Author

GottZ commented Sep 30, 2024

@cumany please take a look

@WarmWelcome
Copy link

WarmWelcome commented Oct 1, 2024

Just installed obsidian and gave this a try. Love the features that it offers, but it immediately became very sluggish and unusable with it. Could this be fixed, please?

Temporary resolutions for the lazy (like me):

  • Change the editing toolbar position to "fixed" or "following"
  • Enable editing toolbar auto hide

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants