Hi HC,

1. question
> if I hide something (a filter) with the *reveal widget*, will it be 
> bypassed or will it still run the filter but not show it? or is there a 
> better  way (for speed) to toggle between things?
>

It will be bypassed (not executed). Any code/content enclosed in a reveal 
widget that evaluates to False is not run and saves precious processor 
cycles, especially precious on mobile :)

2.question
> is there any advantage in combining filters vs. nesting them?
>
 
Combining all your operators in one filter run is generally better than 
having multiple nested filters, but this depends on how you've designed 
your filters, i.e. how general or how specific they are. If you have two 
nested filters, where the outer one produces an output of 100 items and 
then you re-evaluate that output with your inner (embedded) filter you're 
essentially running it twice, which is inefficient.

For example, this is less efficient:

<$list filter="[all[tiddlers]tag[something]]">
<$list filter="[<currentTiddler>has[field]]">

</$list>
</$list>

than this:

<$list filter="[all[tiddlers]tag[something]has[field]]">

</$list>


Please correct me if I'm wrong.

Thanks,
Hubert


On Tuesday, 10 March 2020 10:03:39 UTC, HC Haase wrote:
>
> When I am building my new plugin, at some point things get really slow. 
>
> Can you help me understand where I Can optimize please? I am lacking some 
> basic understanding.
>
> 1. question
> if I hide something (a filter) with the *reveal widget*, will it be 
> bypassed or will it still run the filter but not show it? or is there a 
> better  way (for speed) to toggle between things?
>
> 2.question
> is there any advantage in combining filters vs. nesting them?
>
> example:
>
> reveal if field[x]
>   list filter tag[y] limit[1]
>    stuff to show
>
>   /list filter
> /reveal
>
> vs
>
> list filter field[x]tag[y] limit[1]
>   stuff to show
> /list
>
>
> thanks
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/f0aa988a-dd99-4ac8-9a86-58b75f35618c%40googlegroups.com.

Reply via email to