Callgrinding in Löve (Helpful performance profiling utility)

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
CyaNox
Prole
Posts: 22
Joined: Thu Feb 11, 2010 6:11 pm

Callgrinding in Löve (Helpful performance profiling utility)

Post by CyaNox »

In my years of debugging various performance problems I came across a program called KCacheGrind. The way it visualized and reprented the data to me was very appealing not to mention easy to read so I was curious if something was available for Löve but didn't encounter anything. So I looked further and stumbled on Profiling Lua with KCacheGrind on the Lua-users wiki.

With some little modifications I was able to make it work just fine in Löve (see attached file).

For the windows users out there KCacheGrind also has a precompiled windows binary.

I choose to not alter the io calls in there to the love.filesystem calls with the reason that I or anyone else might also want to use it outside of love.

Its very simple to use just call profiler.start() from which point you want to start the data collecting and profiler.finish() to stop the data collection and write out the collected information.

I did modify the way it saves the file slightly to embed a timestamp of when it finishes the profiling in case of you doing multiple profile sessions in one application run.

Hope this is useful to someone else aside from me ;)
Attachments
profiler.lua
Simple yet effective profiling with callgrind output.
(5.26 KiB) Downloaded 352 times
User avatar
monsieur_h
Citizen
Posts: 65
Joined: Tue Oct 30, 2012 4:43 pm

Re: Callgrinding in Löve (Helpful performance profiling util

Post by monsieur_h »

Necroing this topic to thank you a lot, this tool is neat and straight forward. Nothing to configure, and all useful data at fingertips!
Post Reply

Who is online

Users browsing this forum: dusoft, Google [Bot] and 15 guests