minetest_docs icon indicating copy to clipboard operation
minetest_docs copied to clipboard

Document profiler

Open appgurueu opened this issue 3 years ago • 3 comments

As well as other profiling methods (LuaJIT, simply wrapping in get_us_time etc)

appgurueu avatar Jan 13 '22 17:01 appgurueu

I guess it's about time I pushed this for people to use.

benrob0329 avatar Jan 13 '22 20:01 benrob0329

Indeed we should mention Lua (debug)-based solutions like https://github.com/charlesmallah/lua-profiler.

appgurueu avatar Jan 13 '22 22:01 appgurueu

Some possibly useful resources:

  • dev wiki:
    • https://dev.minetest.net/Lua_Optimization_Tips
    • https://dev.minetest.net/minetest.get_us_time
    • https://dev.minetest.net/Development_Tools#Benchmarking
    • https://dev.minetest.net/Profiler_graph
  • luajit stuff:
    • Website:
      • seems a bit outdated: https://luajit.org/index.html
      • luajit 2.0 git doc: https://repo.or.cz/luajit-2.0.git/blob_plain/HEAD:/doc/luajit.html
      • luajit 2.1 git doc: https://repo.or.cz/luajit-2.0.git/blob_plain/refs/heads/v2.1:/doc/luajit.html
    • The profiler: https://repo.or.cz/luajit-2.0.git/blob_plain/refs/heads/v2.1:/doc/ext_profiler.html
    • wiki: http://wiki.luajit.org/Home#performance-tuning-and-testing
    • Note that there are also eg. the "jit.v", "jit.dump" and "jit.p" modules (you'll need to disable mod security). Dumping the compiler output can be useful to avoid not-yet-implementeds (NYIs, http://wiki.luajit.org/NYI) and to see what your code results in. Dumping can also be done in the web: https://luajit.me/
  • builtin profiler:
    • I haven't really found any doc about this so far IIRC, and I have never completely understood its output. Your only choice might be to RTFS: https://github.com/minetest/minetest/tree/master/builtin/profiler

Desour avatar Jan 14 '22 19:01 Desour