On 29 Nov 2013 15:58, "arthurx" <fc2...@gmail.com> wrote:
>
> Hello agentzh, may I ask what is the performance implication of the above statically compiled lua modules versus the ordinary JIT compiled code?
> Is it the case that our ordinary lua code (say access_by_lua_file) would be JIT compiled when it is first called, that the performance gain of the above static compilation only matters for the first call? If not what percentage of performance gain should we expect to see using the above method?
It is just a bytecode compilation not a JIT compilation so this makes no significant difference.
Justin
> Arthur
>
>
>
> agentzh於 2013年11月23日星期六UTC+8上午5時48分12秒寫道:
>>
>> Hello!
>>
>> On Fri, Nov 22, 2013 at 12:21 AM, Payne Chu wrote:
>> > Can I combine those .o files to .a file and link the .a file to OpenResty's
>> > Nginx ?
>> >
>>
>> Yes, sure! But it also requires minor adjustments :)
>>
>> I've updated that documentation section to reflect this usage:
>>
>> https://github.com/chaoslawful/lua-nginx-module#statically-linking-pure-lua-modules
>>
>> To quote: "
>>
>> If you have just too many .o files, then it might not be feasible to
>> name them all in a single command. In this case, you can build a
>> static library (or archive) for your .o files, as in
>>
>> ar rcus libmyluafiles.a *.o
>>
>> then you can link the myluafiles archive as a whole to your nginx executable:
>>
>> ./configure \
>> --with-ld-opt="-L/path/to/lib -Wl,--whole-archive -lmyluafiles
>> -Wl,--no-whole-archive"
>>
>> where /path/to/lib is the path of the directory containing the
>> libmyluafiles.a file. It should be noted that the linker option
>> --while-archive is required here because otherwise our archive will be
>> skipped because no symbols in our archive are mentioned in the main
>> parts of the nginx executable."
>>
>> Thanks Mike Pall again for the technical support here :)
>>
>> Regards,
>> -agentzh.