Closed eugwne closed 8 years ago
Can it be related to https://github.com/pllua/pllua/issues/17 ? Are you sure it is built with luajit ?
I have execution time for untrusted - 0.2 seconds, trusted - 45 seconds. When I add this lines:
lua_State *luaP_newstate (int trusted) {
...
if (trusted) {
const luaL_Reg luaP_trusted_libs[] = {
...
#ifdef LUA_JITLIBNAME
{LUA_JITLIBNAME, luaopen_jit},
#endif
then execution time for trusted 0.2 seconds.
Checked for luajit on windows and terra for ubuntu.
I'm not sure that luaopen_jit should be used to turn jit on and there is no other option, and if it save to give full access to jit.* table for trusted version or not. I know not much about luajit internals.
As for #17 I make builds with terra for ubuntu, everything is fine, just LUAINC->LUA_INCDIR needs to be done
Tested. I have about the same difference in execution time as you. Something is wrong...
I get this in psql
=# DO $$ if type(jit) == 'table' then print(jit.version) else print('no jit') end $$ LANGUAGE pllua;
INFO: no jit
DO
=# DO $$ if type(jit) == 'table' then print(jit.version) else print('no jit') end $$ LANGUAGE plluau;
INFO: LuaJIT 2.1.0-alpha
DO
Execution time is not the same for this code: