Hi Tony,
I had a thought about this - when I was starting out with TiddlyWiki, I would often write something like "[tag[MyTag]] [backlinks[]]" rather than "[tag[MyTag]] +[backlinks[]]" in the advanced search, which would freeze up my wiki. I've since learned better (for the most part), but it got me thinking about running filters in an async fashion. Here are some timings from my wiki (currently around 8700 tiddlers):
- [all[]] 2306.00ms
- [backlinks[]] with indexer 1196.00ms
- [backlinks[]] without indexer 1421496.00ms
I've had some ideas for running filters in the background, like leveraging web workers, or doing some sort of cooperative multitasking - but honestly I think it might be better just to lean into the new(er) indexing facilities TiddlyWiki has added for filters. This would "lift all boats", so to speak, but the web workers/cooperative multitasking ideas I had have other costs such as memory usage and making filters harder to write.
Instead, I'm wondering if shifting the rendering of many tiddlers that match a filter into the background might be a useful hack in this case, and I don't think it would be too hard to do. There could be a <$lazy-list> widget that could run a filter, store its results, and then transcludes a temporary tiddler. In the background, a timer would take a couple results from the filter at a time and render them to the temporary tiddler, building it up dynamically. In my experience, it's the rendering that takes up much of the time when building large lists of tiddlers like this.
-Rob