My application uses a customized version of Lua 5.0.2, and some clients submit very large (automatically generated) scripts to it. For example, scripts of 200 megabytes or more in size. Everything seems to be working fine, but I wonder how scalable the Lua VM is.
I am especially concerned about scalability OP_JMP. Lua 5.0.2 OP_JMPuses 18 bits to encode the target PC. Thus, it can speed up instructions 262144 as much as possible. Could this limitation be a problem with very large scripts? For example, a 200 megabyte script in which the function at the very bottom of the script calls the function at the very top of the script? Will this limit is reached OP_JMP, or function calls are implemented differently and OP_JMPis only used for encoding control structures, such as for, if... who are unlikely to have to jump more than the 2^18instructions ...
Thanks to everyone who can shed light on this!
source
share