Hi! just starting out with defold and lua, and i was wondering if there is any profiler that is on par with pythons cProfile/ snakeviz.
I’ve tried https://github.com/2dengine/profile.lua, but it only seems to be printing statistic per self written functions, but not the actual operations inside of them.
For example with python i would get detailed statistic (time spent, amount of calls) for pretty much every line of code, whether its some simple arythmetic operation, or a library call like numpy.(…).
I am writing BOIDS implementation and that would help a lot!
I’ve seen the buit-in defold profiler, but havent figured it out at all yet.
I have not heard of that profiler before. I’ve tried ProFi in the past, and it seems similar: https://github.com/jgrahamc/ProFi
Seems a bit overkill to measure the time it takes to add two numbers? Measuring the time it takes per function call is a good start and will help guide you to the hotspots in your code. Once you know where to look it should be fairly straight forward to do an analysis if the function itself.
Take a look https://github.com/defold/extension-lmprof
Use releases with *-vanilla-lua-5.1
for that purpose.
1 Like