Jude Melton-Houghton 939d94d5e3
Document hang bug
2022-12-06 15:12:04 -05:00
2022-10-04 10:44:14 -04:00
2022-09-19 11:06:50 -04:00
2022-09-19 11:06:50 -04:00
2022-12-06 15:12:04 -05:00

LuaJIT Profiler

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_mods list.
  • 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_stop or 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.
Description
No description provided
Readme MIT 30 KiB
Languages
Lua 100%