2012/9/24 Tim Starling <tstarl...@wikimedia.org>

> I suppose a nested switch like:
>
> {{#switch: {{{1}}}
>   | 0 = {{#switch: {{{2}}}
>      | 0 = zero
>      | 1 = one
>   }}
>   | 1 = {{#switch: {{{2}}}
>      | 0 = two
>      | 1 = three
>   }}
> }}
>
> might give you a performance advantage over one of the form:
>
> {{#switch: {{{1}}}{{{2}}}
>    | 00 = zero
>    | 01 = one
>    | 10 = two
>    | 11 = three
> }}
>

I was thinking about something different - to split a long list into a tree
of  "sub-templates", and to use upper templates to select the right one
sub-template. This would avoid parsing of a single, heavy template, but has
the disadvantage of multiple calls to much smaller templates.(one for each
level); so, if basic #switch is unexpectably fast, I don't see a sound
reason to add complexity to the code.

Alex
_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to