[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Lua 5.0.2 scalability with very large scripts
- From: Andreas Falkenhahn <andreas@...>
- Date: Sun, 26 Mar 2017 14:10:39 +0200
In my app I'm using a heavily customized version of Lua 5.0.2.
Recently, I've learned that some customers seem to use very
large scripts with this app, for example a script that is about
180 MB in size.
Those large scripts are generated automatically by another app
of mine which allows the user to create presentations in a
PowerPoint-like interface and those presentations are then
automatically converted into scripts. The presentation whose
script is 180 MB has about 2000 slides or so.
Surprisingly, there don't seem to be any problems when feeding
a 180 MB script to my customized version of Lua 5.0.2. It
all seems to work fine. Still, I'm wondering how scalable
the Lua 5.0.2 interpreter is? Are those customers running
into the risk of hitting a boundary sooner or later with
those extremely large scripts?
From my understanding, a potential bottleneck could be the
OP_JMP opcode. I'm already using a customized version of
OP_JMP which uses 24 bits for the destination PC instead of
18 bits which was the Lua 5.0.2 standard IIRC. But I'm not
sure how exactly Lua uses OP_JMP internally. If it's only
used for coding control structures like IF, FOR, etc.
there won't be any problems because obviously the scripts
don't use control structures which span over great distances.
But maybe OP_JMP is also used for some other things where
it could be a problem if the script is 180 MB?
So I'd like to ask the question if there could be potential
problems with those extremely large scripts, not only in
connection with OP_JMP but also generally. As I said, it
seems to work fine but it still makes me feel somewhat uneasy
because when I customized that Lua version I never thought
it would be fed such large scripts...
Thanks for any thoughts on this! Keep in mind that I'm still
Andreas Falkenhahn mailto:email@example.com