ELProfiler - statistical/sampling profiler

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
User avatar
Imagic
Prole
Posts: 37
Joined: Mon Sep 30, 2019 8:20 am

ELProfiler - statistical/sampling profiler

Post by Imagic » Fri Nov 27, 2020 5:44 pm

Until LÖVE bundles LuaJIT 2.1, which has a built-in profiler, this library can be used as an alternative.

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
Cell size 4, rate 15.
The result with JIT enabled:
Profile: 60.202698584302s, 6020 samples
90.25% ?
9.72% Lua:world.lua:76:draw
0.03% Lua:world.lua:174:update
The result with JIT disabled:
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
The output is not easy to interpret because of the limitations of the debug API, but it may give clues.

Project and documentation: https://github.com/ImagicTheCat/ELProfiler

Post Reply

Who is online

Users browsing this forum: No registered users and 27 guests