Using lua profilers (TODO)
Using linux perf tool to profile minetest
- Compile LuaJIT using LUAJIT_USE_PERFTOOLS flag:
make CFLAGS="-g -DLUAJIT_USE_PERFTOOLS"
- Run server using
LD_PRELOAD
to override the installed luajit library:
LD_PRELOAD=<your-path-here>/LuaJIT/src/libluajit.so ./bin/minetestserver
- run
perf
perf record -Fmax -g -p `pgrep minetestserver`
- examine the output:
perf report
The output will now have [JIT]
records with file names and line numbers of lua code.