Mod
LuaJIT Profiler
Profile mods using LuaJIT's built-in profiler.
complex_installation developer_tools
This Minetest mod lets you use LuaJIT's builtin profiler. This profiler is good for pinpointing expensive parts of mod code.
How to Use
- Add the mod to the
secure.trusted_modslist. - Enable the mod.
- In-game start the profiler with
/jitprofiler_start 1 <filename>. The profiling data will be written to<worldpath>/jitprofiles/<filename>. - Collect data for a while.
- Stop profiling with
/jitprofiler_stopor by exiting the world. - Download FlameGraph if you haven't done so.
- Create a flame graph SVG with
./flamegraph.pl <worldpath>/jitprofiles/<filename> > graph.svg. - Open the SVG with your browser or another viewing program.
- The top level of each stack snapshot will be "C", "G", "I", "J", or "N", representing C code, garbage collection, interpreter, JIT compilation, or compiled code, respectively.
Issues
- This mod can cause the game to hang somehow. Most of the profiling data collected before the hang is saved.
- Sometimes a lot of C code execution is reported in suspicious places. I think this represents time taken by the Minetest engine, but I don't know why the profiler thinks the code is executed inside a Lua function.
- Using this mod with Mesecons luacontrollers can cause crashes for some reason.
Links
- Source: https://github.com/TurkeyMcMac/jitprofiler
- Forum: https://forum.luanti.org/viewtopic.php?t=28135
- Issues: https://github.com/TurkeyMcMac/jitprofiler/issues/new/choose/
- Original ContentDB page: content.luanti.org/packages/jwmhjwmh/jitprofiler/
License
MIT
Development state
AS_IS
| Version | Date | Min engine | Size | Download |
|---|---|---|---|---|
| 2022-10-04 | 2022-10-18 13:25:32 | 2.5 KB | Download |