Board Thread:Watercooler/@comment-5590118-20150701035141/@comment-24473195-20150709133027

Cqm wrote: Your link doesn't say any lua implementation of string functions is more efficient than parser functions it just describes the results of a test using lua's string functions. You can't make those claims without running similar tests with both implementations. In addition, that section does not note how inefficient lua is at creating strings, which is something worth considering when working with multiple strings.

However, the fact that wikipedia has a module to replace the string function part of ParserFunctions may lend credence to your statement of effieciency. It does not give any credence to any module that implements #if, #switch or any other parser function directly, as scribunto is designed to replace the use of parser function logic within templates not to replace parser functions with #invoke which are then used for template logic again. Aside from performance concerns, you're actually making the mess of logic in wikitext worse. Well, there are more tests that were conducted:


 * Wikipedia:User:Dragons_flight/Lua_performance


 * Lua speed


 * Wikipedia:Module:Buffer

So it is more efficient, in fact link 2 highlights the fact that using an #invoke directly may better in cases where speed is important. So it will be a balance between user friendly code, and performance.

As far as #switch is concerned, the performance implications means that just replacing the existing parserfunction will result in better page loads speeds, especially if its functionality is expanded to simply obtain data from a whole template page, rather than through parameter much like the module:cvs. Module:Switch can also be used either for  demo purposes  or as a  temporary  measure to prevent the node count problem, and later simply removed.

You could argue that the Module:Json is also unnecessary, because mediawiki's scribunto supports conversion of json to luatables, but until it arrives in wikia we are stuck using these tools.

Module:if was added mainly for demo purposes and the links above seem to indicate that {{#if parserfunctions will in fact be faster. But this seems to be a design decision rather than a limitation of lua.

In the end these are merely tools to aid in transitioning to lua modules, not something to be used indefinitely. Just like parserfunctions were probably meant to be a temporary measure until something better came by, and it has arrived despite the resistance to the change.