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

By at • 1760次点击
ego008

关于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 1 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 1


lua, 几点, 优化, 性能, 建议


目前尚无回复
登录 后发表评论