lua/utils: improve luaT_newthread performance
<luaT_newthread> created a new GCfunc object for the helper invoked in a protected <lua_cpcall> frame (i.e. <luaT_newthread_wrapper>) on each call. The change introduces a static reference to a GCfunc object for <luaT_newthread_wrapper> to be initialized on Tarantool startup to reduce Lua GC memory usage. Furthermore, since <lua_cpcall> yields nothing on guest stack, the newly created Lua coroutine need to be pushed back to prevent its sweep. So to reduce guest stack manipulations <lua_cpcall> is replaced with <lua_pcall> and the resulting Lua thread is obtained via guest stack. Part of #5201 Reviewed-by:Sergey Ostanevich <sergos@tarantool.org> Reviewed-by:
Vladislav Shpilevoy <v.shpilevoy@tarantool.org> Signed-off-by:
Igor Munkin <imun@tarantool.org>
Loading
Please register or sign in to comment