WHOAH! Is that a proto Test Suite? On Monday, 26 June 2017 22:15:13 UTC+2, Mark S. wrote: > > My informal test, running the code below on TiddlyWiki.com, suggests that > <currentTiddler> may be twice as fast as is[current]. Minutes and seconds > are posted at the top and bottom of the process loop for comparison. > > <<now "mm:0ss">> > <$list filter="1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20"> > <$list filter="[all[tiddlers+shadows]]"> > <$list filter="[<currentTiddler>has[text]]"> > .</$list> > </$list> > </$list> > <<now "mm:0ss">> > > > > > On Sunday, June 11, 2017 at 8:31:32 AM UTC-7, Danielo Rodríguez wrote: >> >> 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 [email protected]. To post to this group, send email to [email protected]. 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/1dbc1104-1500-4409-a34b-401384cfcef6%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.

