Board Thread:Lua Help/@comment-4405550-20160107031030/@comment-24473195-20160108154622

"Wait, I thought the whole point of 'mw.loadData' was to have large tables loaded into memory once per page, rather than per #invoke. So shouldn't there be no limit to how many times you can call it?"

You can load the same table without issues. Loading different tables is a problem, for example:

Module:foo local p ={ main = function { abc = mw.loadData("Module:Food/data") } }

{{#invoke:foo|main} * 1000

This will work without any issue no matter how many times you invoke it in a specific page.

However, loading more than 100 different modules will cause problems:

--Module:foo local p ={ main = function {

abc = {} output = "" for i=1,1000 do   abc = mw.loadData("Module:Food/data".. i)    output = output abc[1] end return output } }

"Well that was the plan...but I may take it in a slightly different direction. Is it possible to have DPL output the arguments for an #invoke? Then just have a single module do most of the heavy-lifting using 'expandTemplate'? Would that be any faster? Or just add more overhead?"

Yes, DPL output or parameters can be sent to lua. It really depends on how you decide to code it. In the end you may not need any DPL at all. Maybe some pseudo-code would make it easier to understand what you want to do and the best way to optimize it.