Memory is very noticeably different.
Opened this issue · 2 comments
AsynchronousAI commented
Using collectgarbage("count")
after requiring a Lua library adds about 5-15kb
but an AOT compiled library adds ~200kb
. Considering the compiled C code is way larger and is representing the bytecode not an AST I understand why, I might make some PRs trying to reduce the memory usage of the compiled code.
AsynchronousAI commented
And I am using -O3
hugomg commented
I suggest measuring how much of that 200kB is from static data (the source code arrays) and how much is the program itself (compiled C code). A known limitation of LuaAOT is that it generates a great amount of C code... One idea that might be easy for you to implement is to tell LuaAOT to only compile the "hottest" functions and leave the rest of the code alone.