Board Thread:General Discussion/@comment-25090105-20150905023527/@comment-24473195-20150905092115

Alxnr wrote: Really? Are the templates pre-loaded (put all of its content) into the caller even before the logical flow starts? Doesn't seem to be efficient to me.

Renamed the title, anyway. I think that perhaps you misunderstood. It will process and expand all templates until it finds its match.

For example:

Using the statement above, "stub, delete and cleanup" are all expanded as it looks for the "right" parameter. It will exclude speedydelete because it found its match.

Generally speaking the #switch function is very inefficient. It is worse when you have too many parameters, so much so that the limiter will block it once it exceeds the maximum node count.

As long as your templates aren't too big I wouldn't worry about it. If you are worried about efficiency I'd recommend using lua which can use super fast hashing technique. You can see a demo module here.