[Lib-Tool] Multi-partite Performance Graph

zorg
Party member
Posts: 3087
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

[Lib-Tool] Multi-partite Performance Graph

Hi everyone!

Looking through the forums, i saw a post in a thread having a screenshot and code snippet for a pretty simple minecraft-like performance graph.

I thought i'd make it a bit more interesting, so (with the approval of the original coder) here's my first released library, a multipartite performance graph.

What this is, is that you can define multiple points to benchmark code execution times, and it will be visualized by a neat graph with a few options. Note: Not having multiple benchmark points "overlap" and measure possibly overlapping code segment exec. times is left as an excercise to the reader.

The basics are very simple:

Code: Select all

-- in love.load or similar
perfGraph = require "mppg"

-- wherever you want to start a benchmark
perfGraph.start('logic')

-- wherever you want it to stop; it will calculate the difference in time between this point and when it was last started.
perfGraph.stop('logic')

-- finally, in love.draw, render the graph
perfGraph.draw() -- no parameter -> draw all of the benchmarks

Haven't had time to put it up onto github yet, so have a demo .love and the lib .lua:
mppg.love
multi-partite performance graph demo
mppg.lua
multi-partite performance graph toolib
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Roland_Yonaba
Inner party member
Posts: 1563
Joined: Tue Jun 21, 2011 6:08 pm
Contact:

Very nice!

Who is online

Users browsing this forum: No registered users and 7 guests