speed check

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
Luke100000
Party member
Posts: 231
Joined: Mon Jul 22, 2013 9:17 am
Location: Austria
Contact:

speed check

Post by Luke100000 »

Here is v2 of speed-test: speed check.
I fixed a lot of bugs and now speed check has a new design and a better perfomance. (and it finally works!)

An example of using:

Code: Select all

require("speedtest")
function love.load()
    speed.load() --load speed check AFTER set the window-size!
end
function love.update()
    speed:start("example")
    local text = ""
    for i=1,1000 do
        text = text.."something "
    end
    speed:stop("example")
end
function love.draw()
    speed.draw() --draw the results
end
Now you can see the deltatime, the average time, the full time, the amount of checks and the percent of all pieces of code.

more examples: (don't forget require, speed.load() and speed.draw())

Code: Select all

function love.keypressed(key)
    if key==" " then
        speed.start("example")
        love.timer.sleep(0.01) --here is something to check, for example sleeping for 10 ms
        speed.stop("example")
    end
end
or

Code: Select all

function love.load()
    speed.start("example")
    love.graphics.newImage("image.png") --how much time it will need to load?
    speed.stop("example")
end
Maybe it can helps you for searching parts in your game/code witch are slow.

Speed check has a diagram were you can see the max deltatime in ms of 1 second and two lines, one the limit for 60FPS and one for 24FPS.
speedtest.lua
Yes I now, it is named "speedtest", but now its speed check
(4.45 KiB) Downloaded 98 times
screenshot.png
screenshot.png (68.66 KiB) Viewed 3831 times

functions


speed.start(name)
--start a check

speed.stop(name)
--stop a check

speed.draw()
--draw the results of all checks an the diagram

speed.load()
--load or reload speed check
Last edited by Luke100000 on Sat Apr 26, 2014 1:42 pm, edited 8 times in total.
User avatar
T-Bone
Inner party member
Posts: 1492
Joined: Thu Jun 09, 2011 9:03 am

Re: speed-test

Post by T-Bone »

Do you really need a library for something like this? Isn't it just two lines of code anyway?

I hope I don't sound too negative, I'm not saying that your library is bad in any way, I just question its necessity.
User avatar
Luke100000
Party member
Posts: 231
Joined: Mon Jul 22, 2013 9:17 am
Location: Austria
Contact:

Re: speed-test

Post by Luke100000 »

T-Bone: Yes, You can use these two lines, but in my speed-test you can see the % off all and etc. in a clear list. Soon I will show a sreenshot while I'm pressing the key.
Last edited by Luke100000 on Mon Apr 07, 2014 2:45 pm, edited 1 time in total.
User avatar
Luke100000
Party member
Posts: 231
Joined: Mon Jul 22, 2013 9:17 am
Location: Austria
Contact:

Re: speed-test

Post by Luke100000 »

Can I add something?
User avatar
RedHot
Citizen
Posts: 87
Joined: Mon May 27, 2013 2:43 pm
Location: Poland

Re: speed-test

Post by RedHot »

Sure
User avatar
Luke100000
Party member
Posts: 231
Joined: Mon Jul 22, 2013 9:17 am
Location: Austria
Contact:

Re: speed-test

Post by Luke100000 »

funny... so tell me what
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

Re: speed-test

Post by raidho36 »

A function to screw up results randomly.
davisdude
Party member
Posts: 1154
Joined: Sun Apr 28, 2013 3:29 am
Location: North Carolina

Re: speed-test

Post by davisdude »

It would be incredibly hard, but you could ask for a task, parse it, then compare the time the tasks take.
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
User avatar
Luke100000
Party member
Posts: 231
Joined: Mon Jul 22, 2013 9:17 am
Location: Austria
Contact:

Re: speed-test

Post by Luke100000 »

raidho36 wrote:A function to screw up results randomly.
why?
User avatar
Luke100000
Party member
Posts: 231
Joined: Mon Jul 22, 2013 9:17 am
Location: Austria
Contact:

Re: speed-test

Post by Luke100000 »

davisdude wrote:It would be incredibly hard, but you could ask for a task, parse it, then compare the time the tasks take.
I have no idea how I can do that, sorry.
Post Reply

Who is online

Users browsing this forum: No registered users and 20 guests