I tried it on Conway's game of life available on the forum by just adding those lines at the top of the main.lua:
Code: Select all
local Profiler = require("ELProfiler")
Profiler.setClock(love.timer.getTime)
Profiler.start()
function love.quit() print(Profiler.format(Profiler.stop())) end
The result with JIT enabled:
The result with JIT disabled:Profile: 60.202698584302s, 6020 samples
90.25% ?
9.72% Lua:world.lua:76:draw
0.03% Lua:world.lua:174:update
The output is not easy to interpret because of the limitations of the debug API, but it may give clues.Profile: 59.742081810862s, 5974 samples
49.23% ?
45.41% Lua:world.lua:174:update
4.00% Lua:world.lua:76:draw
1.36% Lua:world.lua:97:setCellState
Project and documentation: https://github.com/ImagicTheCat/ELProfiler