Benchmark/performance question

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
kexisse
Citizen
Posts: 56
Joined: Wed Jun 13, 2012 2:52 pm

Benchmark/performance question

Post by kexisse »

I have made a (very) simple benchmarking .love project, with 500 bouncing images.
I think my game will have many hundreds of sprites in it, so I wanted to check performance before starting.

To use the tool:
  • Turn the sets of images on and off with number keys 1-5.
  • Toggle FSAA between 0 and 2 with "F" key
On my macbook, and without FSAA, I get ~15fps with all layers, ~50fps will all layers other than layer #4, and ~160fps with single layers (other than #4). With FSAA on, I get < 10fps with all layers, and 20-30 with a few layers, but always less than 40fps.

I have some questions:
  • Are there any techniques in my code I'm missing that could improve the framerate?
  • One image in particular, number 4 (the weird aardvark-looking one), affects the framerate significantly. It is slightly larger than the others, but I can't tell why it has such a negative affect on the framerate. Can anyone explain?
  • FSAA completely destroys my framerate. Why? Are there alternatives? Do I really need it when just rendering pngs? I couldn't see a noticeable difference in quality.
For simplicity, the part of the draw loop that renders the images is as follows:

Code: Select all

  for index, image in ipairs(images) do
    if show[image.img_num] then
      love.graphics.draw(image.img, image.x, image.y, image.rot, 1, 1, image.img:getWidth() / 2, image.img:getHeight() / 2)
    end
  end
Attachments
bench.love
Simple benchmarking tool
(304.68 KiB) Downloaded 131 times
Zeliarden
Party member
Posts: 139
Joined: Tue Feb 28, 2012 4:40 pm

Re: Benchmark/performance question

Post by Zeliarden »

Yo!
with 500 bouncing images.
its 834 (167 per image) bouncing images in your attached love file
I think my game will have many hundreds of sprites in it, so I wanted to check performance before starting.
I wouldnt worry about it, just make your game
One image in particular, number 4 (the weird aardvark-looking one), affects the framerate significantly. It is slightly larger than the others, but I can't tell why it has such a negative affect on the framerate. Can anyone explain?

Code: Select all

image 4 = 842x595 = 500990 pixels
other images = 256x256 = 65536 pixels
500990/65536 = 7,644500732421875 times more pixels
FSAA completely destroys my framerate. Why?
your graphics card probably have poor support for FSAA
Do I really need it when just rendering pngs? I couldn't see a noticeable difference in quality.
then you dont need it :)
User avatar
Xgoff
Party member
Posts: 211
Joined: Fri Nov 19, 2010 4:20 am

Re: Benchmark/performance question

Post by Xgoff »

the aardvark one isn't power-of-two which will cause problems with some graphics cards. those that are ok with them will probably still have performance issues with them.

iirc love 0.8 (if you're using that) will automatically pad the image but since the image is going to be larger that will probably be more expensive anyway
User avatar
Lafolie
Inner party member
Posts: 809
Joined: Tue Apr 05, 2011 2:59 pm
Location: SR388
Contact:

Re: Benchmark/performance question

Post by Lafolie »

I wish the bouncing fireflowers was a screensaver.
Do you recognise when the world won't stop for you? Or when the days don't care what you've got to do? When the weight's too tough to lift up, what do you? Don't let them choose for you, that's on you.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests