luajit2
luajit2 copied to clipboard
upgrading the luajit the CPU increased by 20% ,performance drop
client: ab -n10000000 -c40 -k http://www.hello.com/
server: openresty-1.13.6.2 LuaJIT-2.1-20180420 some lua scripts
upgrading the luajit version to luajit2-2.1-20220411 , the CPU increased by 20%, QPS and response time did not change(compared to the old luajit version)
FlameGraph c-on-cpu.cbt
c-on-cpu.bt.txt
c-on-cpu.svg.txt
Remove file suffixes .txt
@agentzh @siddhesh @zhuizhuhaomeng @doujiang24
thanks

From the graph above, I suspected that the lj_BC_TGETS was the underlying cause of problem ,however ,there is little information except lj_BC_TGETS ,moreover, we don't know much about lj_BC_TGETS behind the screen, any ideas?
lj_bc.h lj_BC_TGETS is a field or method access in the interpreter, i.e. obj.field or obj:method
/* Table ops. */
_(TNEW, dst, ___, lit, gc)
_(TDUP, dst, ___, tab, gc)
_(GGET, dst, ___, str, index)
_(GSET, var, ___, str, newindex)
_(TGETV, dst, var, var, index)
_(TGETS, dst, var, str, index)
_(TGETB, dst, var, lit, index)
_(TGETR, dst, var, var, index)
_(TSETV, var, var, var, newindex)
_(TSETS, var, var, str, newindex)
_(TSETB, var, var, lit, newindex)
_(TSETM, base, ___, num, newindex)
_(TSETR, var, var, var, newindex)
\
which luajit version did you upgrade from? @fairyqb
upgrade LuaJIT-2.1-20180420 to luajit2-2.1-20220411 @zhuizhuhaomeng
@fairyqb would you please use the lj-lua-on-cpu in OpenResty XRay to profile your process?
@fairyqb would you please use the lj-lua-on-cpu in OpenResty XRay to profile your process?
results are similar to stapxx
@fairyqb is it possible for you to bisect luajit2 to find the changes that caused the problem?
@fairyqb is it possible for you to bisect luajit2 to find the changes that caused the problem?
bisect ??
man git bisect