Re: My bytecode is slow
[
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: 2014年3月26日 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.