Hello,

I was creating some template tiddlers when I suddenly discovered myself 
using <currentTiddler> a lot within list widgets.

This is what was natural for me at that moment, but I just remembered that 
I before I normally use the filter operator [is[current]] or [all[current]] 
and the doubt appeared. Which one has better performance? Using the 
<currentTiddler> variable or the [is[current]] filter operator.

For me makes sense that just accessing a variable is much more performant 
than just filtering all the tiddlers to see which one is the current one. 
One usage example is as follows:


<$list filter="[<currentTiddler>has[text]]">
 Text if the field exists
</$list>
<$list filter="[<currentTiddler>!has[text]]">
  Text if the field does not exist
</$list>


Maybe there are situations where you want to use the filter version instead 
of the variable, but since both depend on the value of the current tiddler 
variable, I can't think of any situation like this.

Any reasoning about this is very welcome. If currentTiddler is more 
performant for this base cases, I think it should be included as some part 
of good practices or something like this.

Regards 

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/5b2a3789-b93d-4d83-994c-8372d163a9ce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to