Alright, since I don’t wanna just complain about things, here are some more measurements and a possible improvement by using a different filter with the same result…
I checked these filters:
\define tagger() [tag[$:/tags/Journal]]
{{{ [tag[$:/tags/Journal]count[]] }}} <!-- tagged -->
{{{ [!tag[$:/tags/Journal]count[]] }}} <!-- untagged -->
{{{ [!subfilter<tagger>count[]] }}} <!-- untagged -->
{{{ [!filter<tagger>count[]] }}} <!-- untagged -->
{{{ [all[]] -[tag[$:/tags/Journal]] +[count[]] }}} <!-- untagged -->
{{{ [all[]count[]] }}} <!-- all -->
Here are the measurements (these were taken on a faster machine than the OP, but on the same wiki):
[!filter<tagger>count[]] 72.70ms
[!subfilter<tagger>count[]] 43.40ms
[!tag[$:/tags/Journal]count[]] 41.70ms
[all[]] -[tag[$:/tags/Journal]] +[count[]] 7.60ms
[all[]count[]] 0.80ms 10 8.00ms 8.00ms 2.00ms 1.00ms
[tag[$:/tags/Journal]count[]] 0.60ms 10 6.00ms 6.00ms 3.00ms 0.00ms
So, !filter
and !subfilter
are surprisingly slow, even though they use the quick tag[]
syntax, even slower than !tag[]
. An improvement seems to be the [all[]] -[tag[foo]]
syntax, even though it still takes more than 10× more time than tag[]
.
Interestingly, [all[]]
is slower than [tag[]]
, despite basically doing nothing.
PS: A disadvantage of -[tag[foo]]
is that it always receives all non-shadow tiddlers as input, while +[!tag[foo]]’ would only operate on the previous input. Not sure that that makes a difference time- or result-wise, though…