关于lua 性能优化的几点建议

By ego008 at 348.5天前 • 470次点击 • 1收藏

关于lua 性能优化的几点建议

Several suggestions on performance tuning:

1. Try running your Lua scripts with luajit's -jv option to see what is aborting JIT compilation. Work-around the NYI items shown in the output.

2. Try running your Lua scripts with the builtin low-overhead profiler, for example, with the -jp=vf20 option. See

http://repo.or.cz/w/luajit-2.0.git/blob_plain/refs/heads/v2.1:/doc/ext_profiler.html

for details. (Ensure your Lua scripts run long enough like seconds because the profiler is based on sampling).

3. Try generating a C-land on-CPU flame graph for the luajit process running your scripts: https://github.com/agentzh/nginx-systemtap-toolkit#sample-bt This graph can show CPU time distribution on a lower level, the VM level, than LuaJIT's builtin profiler (which works on the Lua code level).

Best regards,

-agentzh

https://groups.google.com/forum/#!topic/openresty-en/96gjs476ZoI 8

lua, 性能


登录 后发表评论