ivan-lednev / better-search-views

Outliner-like breadcrumb trees for search, backlinks and embedded queries
MIT License
245 stars 8 forks source link

severe slowdowns (with Backlinks tab open) and errors #18

Open trainbuffer opened 1 year ago

trainbuffer commented 1 year ago

Hi!

I tried running the plugin for a few hours and experienced severe slowdowns with the Backlinks tab open in the sidebar and notes containing lots of backlinks. It seemed a few times unlinked mentions were being calculated, although I never clicked on the Unlinked mentions title.

I also saw this error pop up a few times. The note referred to looks like a run-of-the-mill note and loads fine.

Screenshot 2023-08-24 at 9 54 12
Error while mounting Better Search Views tree for file path: 00 meta/05--css/edi/img highlight.md. Reason: Error: No section cache found in 00 meta/05--css/edi/img highlight.md
    at createContextTree (plugin:better-search-views:4483:15)
    at Patcher.mountContextTreeOnMatchEl (plugin:better-search-views:4680:25)
    at e.eval (plugin:better-search-views:4643:23)
    at e.wrapper [as renderContentMatches] (plugin:better-search-views:4219:20)
    at app.js:1:1242238
    at app.js:1:1198807
    at app.js:1:236999
    at Object.next (app.js:1:237104)
    at a (app.js:1:235822)
reportError @ plugin:better-search-views:4668

Turning off the plugin and closing/opening the vault brought the speed back to normal.

macOS 13.5, Obsidian v1.4.4, Better Search Views 0.2.0 Let me know if you'd like me to test anything.

Good luck!

ivan-lednev commented 1 year ago

Hello, @trainbuffer,

Thank you for the feedback! Let's gather some more info: 1) Did you experience slowdowns a) continuously while running obsidian or b) only when opening specific files c) or did they 'accumulate' over time, getting worse? 2) If b), did the slowdown disappear when you closed the file? 3) Was it the only error you saw in the console? Were there other files that caused the error? 4) Do you use canvas a lot?

chadrach commented 1 year ago

I am seeing the same error, and I am fairly confident that it is related to the insider build 1.4.4, which released yesterday. This update added YAML property values to search results (e.g., Author: [[JK Rowling]]). I am only seeing the console error pop up when I navigate to a file where the backlinks include a property value.

ivan-lednev commented 1 year ago

Thank you @chadrach! This insight is very helpful ❤️

ivan-lednev commented 1 year ago

Okay, I've played around with the insider build, and indeed I'm seeing errors when using the new [key:value] search operator - this is quite easy to fix.

However, I wasn't able to reproduce the slowdown. @chadrach, have you noticed any slowdown in your vault while using the new insider build?

@trainbuffer, do you use a lot of properties in your vault? Do you have a lot of note links in those properties?

chadrach commented 1 year ago

I don't have any noticeable slowdown, but my YAML use is minimal

trainbuffer commented 1 year ago

@ivan-lednev

Thanks for the prompt reply.

Just be be sure it wasn't something funky with my vault, I copied my notes (1609 files, 70 folders) into the Sandbox with only Better Search Views enabled. Default settings and theme, and no other Community plugins installed. Tried to answer your questions from above ->

  1. The slowdowns and freezes (scrolling, sidebar buttons not responding, clicking on tabs not responding, etc.) only seemed to happen with certain notes. For example, I put:
    ~~~query
    html
    ~~~

    in the Start Here note and Obsidian was pretty much unresponsive until I could click out of that note. As mentioned in my first post, having Backlinks open in the right sidebar would also cause slowdowns if there were a lot of backlinks to the note.

If the Backlinks tab was closed and there were no embedded queries in a note, Obsidian functioned normally.

  1. Yes, closing Backlinks or certain notes restored responsiveness to the UI

  2. The error I posted above was the only error I saw in my vault, but after using the Sandbox for ~30 minutes, I saw the same error a few times but with different files.

  3. The Canvas plugin is enabled in my vault and the Sandbox, but no Canvas files were open (and I don't use the Canvas much).

do you use a lot of properties in your vault? Do you have a lot of note links in those properties?

I currently have 22 properties listed in the Files properties tab, and I have no idea what 5~6 of them are. Time for a clean-up. 😂

Hope this helps!

ivan-lednev commented 1 year ago

@trainbuffer, @chadrach, please update and re-check. The errors should be gone. For now, if you use the new property search syntax, the plugin will fall back on the native search UI.

@trainbuffer, I'm not sure it'll fix the slowdowns though. In case it doesn't, are you up for a Skype call and some debugging?

ivan-lednev commented 1 year ago

Closing this as stale.

csss1234 commented 10 months ago

I have this problem. It happens with notes that have several backlinks, like more than 15. The first 15 load instantly, the next ones take 5 seconds to load, and Obsidian is unusable in that time (Can't edit the note). The notes I'm using have no properties / yaml. I tried renaming and deleting all the content of the note, but that didn't fix it.

ivan-lednev commented 10 months ago

Hello, @csss1234,

You'll have to help me here:

  1. Can you share the file that causes slowdowns?
  2. Can you share the error messages in the developer console, if there are any?