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 report - Dataview significantly slows down link creation #1154

Closed
Caffa opened this issue Jun 6, 2022 · 11 comments
Closed

Bug report - Dataview significantly slows down link creation #1154

Caffa opened this issue Jun 6, 2022 · 11 comments
Assignees
Labels
bug Something isn't working.

Comments

@Caffa
Copy link

Caffa commented Jun 6, 2022

What happened?

I found that enabling dataview causes the vault to freeze for several seconds when I try to create a link (type with [[ ) and it works like safe mode when dataview is disabled. I tried reinstalling obsidian but that didn't help.

Here is a video of enabling and disabling dataview + testing for whether the link completion bug is present. https://youtu.be/aMkZpt8hTFw

I have the performance snapshot from developer's tools. https://www.dropbox.com/sh/hr4ny4ikwpa6g6x/AAABwnbdQQIX1e2SHDd1Kjyta?dl=0 Uploaded here. This is only enabling and disabling the dataview plugin.

I am on a M1 Mac Studio 2022. Monterey Version 12.4 (21F79)

EDIT:

Testing on a clean vault with notes and only dataview = no bugs
Dataview works normally in a clean vault (no notes, no plugins other than dataview). It just causes issues in my main vault which has notes when other plugins are enabled. so dataview alone is fine.

Checked by reinstalling latest version from community + restarting obsidian and the bug is still present in main vault with other plugins enabled.

it seems to be that when I type [[ it will freeze, but if I type fast enough [[hi then less lag

Vault has 2560 notes

  • sidebars are closed
  • no notes in sidebar
  • live preview is on
  • no dataview tables in current note

DQL

No response

JS

No response

Dataview Version

0.5.26

Obsidian Version

0.14.6

OS

MacOS

@Caffa Caffa added the bug Something isn't working. label Jun 6, 2022
@AB1908
Copy link
Collaborator

AB1908 commented Jun 6, 2022

Can you try doing a similar divide and conquer on dataview versions to see where it started?

@Caffa
Copy link
Author

Caffa commented Jun 6, 2022

After testing on dataview version, I found that:

  • dataview version 0.4.22 doesn't have this issue (works with no bugs)
  • dataview version 0.5.0 does have this issue
  • dataview version 0.4.26 doesn't have this issue (works with no bugs) - this release reverts to 0.4.22

Essentially 0.5.0 onwards has this bug

@jnsgruk
Copy link

jnsgruk commented Jun 6, 2022

I don't know whether it's linked to this issue, but I've also noticed significant performance issues with 0.5.x releases - I've downgraded back to 0.4.26 for now. My vault is ~950 notes with ~4500 links. If I remember correctly, it started when the indexing was introduced - the developer console seems to indicate that indexing has been successful, though

Edit: I should note: I'm on Linux running Obsidian 0.14.15 with installer 0.14.6

@blacksmithgu
Copy link
Owner

By indexing, do you mean the change which added the index caching (for faster startup)? Dataview has always been a data index and has parsed markdown files since the earliest releases.

I wonder if that is actually running on the main thread - that would be bad if so.

@blacksmithgu
Copy link
Owner

@Caffa - I appreciate you including a performance dump; there is definitely something suspicious going on, though it's not immediately obvious from the dump (since plugins+obsidian strip a lot of metadata in production builds).

Do you have any other notable plugins in your vault, like Supercharged Links or etc, that could affect link behavior? Dataview does not change this behavior by default, but any plugins that implicitly use the Dataview API might.

@blacksmithgu
Copy link
Owner

Looking a little more at the performance dump, it seems the specific issue is

  1. Another plugin is calling Dataview to get page metadata.
  2. Dataview does some internal conversions on this page metadata which are very slow for some specific pages.

So the indexing seems fine; the real issue appears to be that a convenience function I wrote a few months ago is very slow for large files!

@blacksmithgu
Copy link
Owner

I've fixed the underlying issue, and as a nice side effect, I think everything that uses DataviewJS page queries is suddenly going to become noticably faster.

@Caffa
Copy link
Author

Caffa commented Jun 8, 2022

@Caffa - I appreciate you including a performance dump; there is definitely something suspicious going on, though it's not immediately obvious from the dump (since plugins+obsidian strip a lot of metadata in production builds).

Do you have any other notable plugins in your vault, like Supercharged Links or etc, that could affect link behavior? Dataview does not change this behavior by default, but any plugins that implicitly use the Dataview API might.

I do have supercharged links - that might be the problem.

@blacksmithgu
Copy link
Owner

Try updating to the latest version to see if the behavior has improved.

@rkm3
Copy link

rkm3 commented Jun 9, 2022

+1 I found this issue looking for ways to improve performance using 4.22. Not sure what was fixed, but my vault seems much faster with 0.5.31. Thanks.

@blacksmithgu
Copy link
Owner

If you encounter any further slowness, please make issues with performance profiles; they've uncovered several unintentional bugs which made Dataview needlessly slow :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working.
Projects
None yet
Development

No branches or pull requests

5 participants