[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: My bytecode is slow
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Wed, 26 Mar 2014 09:29:39 -0300
> -- main.lua
> require("x")
> require("y")
Like I said in stackoverflow, these two invocations are not equivalent:
1. lua main.lua
This runs x, y, main exactly once each in this order.
2. lua main.out after luac -o main.out -s x.lua y.lua main.lua
This runs x, y, x, y, main, in this order.
So x and y and run twice.
The problem is that luac does not understand require.
luac -o main.out -s x.lua y.lua main.lua
generates code that runs x, y, main in that order. When main is run,
it runs x and y again.