On 21/09/12 16:06, Strainu wrote:
I'm just curious: would LUA improve memory usages in this use case?
Yes, it's an interesting question.
I tried converting that template with 37000 switch cases to a Lua array. Lua used 6.5MB for the chunk and then another 2.4MB to execute it, so 8.9MB in total compared to 47MB for wikitext. So it's an improvement, but we limit Lua memory to 50MB and you would hit that limit long before you loaded 15 such arrays.
It's still an O(N) solution. What we really want is to avoid loading the entire French census into memory every time someone wants to read an article about France.
-- Tim Starling