It’s not the number of tags, or the filters that are used. Finding the tags and calculating the filters needs about 40 milli-seconds with v5.2.0 (I did some test with an updated wiki.)
What causes the lag here, is the number of “tag-pills” that are created in 1 tiddler. There are 3002 tag-pills drawn in 1 tiddler.
Every tag-pill is constructed from $:/core/ui/TagTemplate which contains 16 lines of wikitext code. It contains a call to the tag-pill-body macro which in sum also has about 16 lines of wikitext.
So in sum to create this tiddler TW has to compute 3002 x 32 lines of wikitext. That’s about 96.000 lines of code that have to be interpreted. On my PC this needs about 1.6 seconds …
With a little bit of tweaking I could bring it down to 1.2 seconds. (There seems to be some unnecessary copy/pasted code ![]()
Interpreting and drawing the whole stuff to the DOM is the process that needs the time here.
(3002 tag-pills create about 9000 DOM elements. Eg: a DIV is 1 DOM-element.)
While finding tags and calculating filters is highly optimized in the core already, drawing tag-pills is not. The code used to create the tag-pills is at least 5 years old and it can’t be cached, as it is at the moment. So the whole work has to be done over and over again atm. …
So there should be some room for improvement with a bit of tinkering.