wikilabs / plugins

TW5 plugins: https://wikilabs.github.io
30 stars 8 forks source link

[BUG] Backlink handling with 5000++ tiddlers freezes the wiki. #129

Open pmario opened 1 year ago

pmario commented 1 year ago

Describe the bug

[BUG] Backlink handling with 5000++ tiddlers freezes the wiki.

Emily — heute um 23:13 Uhr Maybe I'm not understanding how to use them properly. What I'd like to do is get a list of all tiddlers linked to via aliases in the text field of a tiddler. [links[]] will give me all the normally hardcoded links, but misses the aliases. I'd also like to avoid [aliasbacklinks[]] if possible, because every time I've experimented with it, it's caused my wiki to freeze. I suspect my wiki is just too large for that filter to be performant, which is fine - I don't think it does what I'm looking for anyway, and I don't need to collect aliased links except on a per-tiddler basis.

pmario — heute um 23:19 Uhr How many tiddlers do you have in your wiki?

Emily — heute um 23:20 Uhr 5300+ at present, and I use aliases rather liberally.

pmario — heute um 23:22 Uhr If you open the Right Sidebar -> Aliases tab ... does your wiki freeze? Bild

Emily — heute um 23:23 Uhr Yes

pmario — heute um 23:24 Uhr Ah.. OK that's bad. ... I'll create an issue at GitHub. ... So I don't forget about it. ... I'll try to create several 1000 tiddlers with aliases for testing. Will need some time

Emily — heute um 23:25 Uhr ETA: I let the alias tab keep working on it, and it just finished loading. Took about 2 minutes.

pmario — heute um 23:26 Uhr ouch ... That definitely needs to be fixed :)

Emily — heute um 23:26 Uhr Thank you for looking into it! I love the plugin, and it's been invaluable already, even if I can't do the exact thing I'm imagining. In case it's a useful datapoint, my current wiki is 11 MB and I'm using a single-file setup.

I also use fields extensively, sometimes for multiple paragraphs of content; I'm not sure if that would impact the filter performance, though I'm sure it's not exactly the intended usage.

pmario Using fields should have no influence on performance Do you have images embedded in your wiki? because the file size with 11 MB looks ab bit too big for 5300 tiddlers. Is there very much text in your tiddlers? How many lines in average? Which TW version do you use?

Emily — heute um 23:36 Uhr I don't have any embedded images, but I do have a lot of text. I'm not sure how to find an average count, but I have multiple tiddlers over 30,000 characters, and probably hundreds over 5000. I'm using 5.2.5

pmario commented 1 year ago

From: https://discord.com/channels/531220230790447154/531227284871446558/1136715374021328936

I use things like [[an alias that doesn't exist yet|?]] a lot, but that means if I end up creating the tiddler "an alias that doesn't exist yet" in the future, uni-link won't be able to find it.

my response

There is a new [[case insensitive title|??]] link, but at the moment it will only search for titles, because of performance implications. This may change with the new code. I'll add an issue to the GH repo about our discussion here. So I should not forget about it

There should be a possibility that the new title-link will search for titles first and then for aliases.