Very Slow UI

Hi everyone, I'm in the process of moving from Obsidian to Silverbullet. It's been great. But I've immediately discovered a problem.

Normally, I have pretty good responsiveness with navigation:

My notes are organized with index files that links to different notes. When I have an index file with many internal links (in this example, about 70 to 80 links), the UI becomes painfully slow to navigate via cursor. When typing, there's frequent skips and lags in keys showing up:

Any thoughts? I've tried few different things such as disable backlinks in page, disable custom css, and also setting custom config:
config.set("index.search.enable", false)
config.set("index.paragraph.all", false)

But it's still slow to browse. For index pages, it's basically unusable right now.
I've searched in the forum, but doesn't seem like other people are having this problem. I have about 3000 notes so far.
I even went to posts where people are showing off their Spaces. They all have index files too. And it doesn't seem like they are having slow UI issues.

I’ve not seen this. What system are you on? What browser, have you tried others, what operating system, RAM, CPU?

Thank you for the reply. I have it hosted in Docker on a Mac M4 with 24 GB of RAM. So it should be adequate.

I've used it in Zen/Firefox. I also use it in Silverbullet+ synced to my Windows Desktop. It has i5 CPU with 32 GB of RAM.

Other things I've tried: remove .git and .obsidian folders.

Other thing that I found is slow is when I search for long names. The longer the name, the slower it gets:

Funny thing you mentioned browser. When I used Chrome, it's faster than both Silverbullet+ and Zen. You can still feel the ms delay but it is faster:

.

I just didn't expect silverbullet+ to be slower.

I have the repository made public here if you want to take a look to see if there's something wrong with the directory:

Thanks again for all the help.

Yeah, this happens to me as well in pages that have lots of internal wiki links on them.

When I type in this kind of page, I see in the Chrome console messages like these:

[Violation] Added non-passive event listener to a scroll-blocking <some> event. Consider marking event handler as 'passive' to make the page more responsive. See <URL>
document_editor_js.ts:1

[Violation] 'setTimeout' handler took 195ms
logger.ts:43

[Violation] 'keydown' handler took 164ms
index.js:4251

[Violation] 'keyup' handler took 157ms
index.js:4251

[Violation] 'keyup' handler took 157ms
[Violation] 'keydown' handler took 158ms
[Violation] 'keydown' handler took 159ms

I've tried to pin down the source of these delays a couple of times in the past with no luck.

This is what I see in line 4251 of node_modules/@codemirror/view/dist/index.js. I'm not sure how significant it is, though

I'm no frontend expert, so please take my account with a grain of salt, but I've made some experiments on the "Performance" tab in Chrome's developer tools.

Following the javascript call stack triggered in response to a keydown event, I'm seeing this:

This might be significant because is shows a function called processWikiLink in the stack and points to ref.ts:106:17 and refs:60:10 as sources of most of the delay. And this seems to be part of the Silverbullet codebase: /plug-api/lib/ref.ts.

refs.ts:60

refs.ts:106

Any thoughts?

Also not a frontend expert, but it does seem like long index page would take a lot of time to parse out internal links.

So I've basically stripped down the Space to only markdown files, no config, no plugins/scripts. It's still having issues with index pages. So I don't think it's a configuration issue.

Obsidian also uses Codemirror underneath. I remember in the early days, it also had issues with displaying wikilinks and backlinks and slowdown. But it's not having any issues currently.

Ok this is helpful info. I can look into this.

Ok, I think I found what this may be. Just fixed it on main, should be in the edge builds soon and will be part of the next release.

Hi thanks for the update. I'll test it out once it's pushed to the next build.

In a similar vein, here's the performance tab for the slowdown with search. Not sure how much this helps or is able to be optimized:

slow down happens with fuzzy_search.ts mostly:

Here's the code line: