[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: My bytecode is slow
- From: Ico <lua@...>
- Date: Wed, 26 Mar 2014 17:22:45 +0100
* On 2014-03-26 13:29:39 +0100, Luiz Henrique de Figueiredo wrote:
> > -- 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.
Note that the original mail stated:
"[...] but when i delete all requires from main.lua and use commands for
compiling: [...]"
--
:wq
^X^Cy^K^X^C^C^C^C