Author: mmantel
Description:
Per discussion at http://en.wikipedia.org/wiki/Wikipedia:VPT#Lua_10-second_timeout_unusable_for_articles
If you transclude a Lua-powered template such as:
{{bananas| <... complicated parserfunctions ...> }}
the input parameter is apparently not computed until the Module behind the template accesses frame.args, which invokes Scribunto_LuaSandboxCallback::getExpandedArgument. The time spent preprocessing the parameters is thus counted against the 10-second time limit on Lua execution.
This violates my expectations as an editor. In my simplistic mental model of the parser, the template parameters are processed before any Lua code is invoked.
It has caused a problem on enwp, where {{hexadecimal}}, a simple decimal-to-hexadecimal conversion template, has been converted to Lua. In {{weather box}}, some complex parser functions are used, and the results are passed into {{hexadecimal}}, dozens of times. On pages with several weather boxes, Lua timeouts result. On [[Climate of Russia]], for instance, 8s of Lua time is spent in getExpandedArgument.
This could probably be fixed by converting {{weather box}} to Lua as well, but there are many templates that need conversion, and it seems unwise to distort editor priorities this way.
Per BJorsch in the linked VPT thread, "The counting of calls into PHP against the time limit in general is intentional, but there is a good case for making an exception for getExpandedArguments()."
Version: unspecified
Severity: normal
URL: https://en.wikipedia.org/w/index.php?title=Wikipedia:Village_pump_(technical)&oldid=542013515#Lua_10-second_timeout_unusable_for_articles
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=64163