Strange Performance Issues

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
Simtex
Prole
Posts: 39
Joined: Sun Dec 14, 2008 5:31 am

Strange Performance Issues

Post by Simtex »

I've got some strange performance issues that I wanted to see if others were getting. Now this is running on a laptop video card, but one of the newer ones (Intel 4500MHD). On this computer I can play this...

http://riot-web-static.s3.amazonaws.com ... ens/19.JPG
(game called League of Legends)

...at around 25-30 fps. So it's not completely powerless.

Anyway, the following LOVE program runs at ~720 FPS on my computer:

Code: Select all

function love.draw()

	love.graphics.print("FPS: " .. love.timer.getFPS(), 50, 20)
	
end
So far so good, but if I add three more lines of text, like this:

Code: Select all


function love.draw()

	love.graphics.print("FPS: " .. love.timer.getFPS(), 50, 20)

	love.graphics.print("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", 50, 80)
	love.graphics.print("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", 50, 100)
	love.graphics.print("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", 50, 120)

end
The FPS drops to 200, a difference of about 520 FPS. This is with LOVE 0.7.2

Combined with some textures, this is making games with rather simple textures (all of which follow the Power-of-2 rule properly) plus some text, slow down to ridiculous levels. I've made sure the usual suspects are eliminated (trying to create fonts every update, etc.) so I'm starting to run out of optimizations. It really seems like this stuff shouldn't be such a problem.

Can anyone run the two above LOVE programs and see what kind of results they get?
User avatar
Jasoco
Inner party member
Posts: 3727
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Strange Performance Issues

Post by Jasoco »

Fonts are getting an overhaul in 0.8 I believe. I assume it includes image fonts.
User avatar
tentus
Inner party member
Posts: 1060
Joined: Sun Oct 31, 2010 7:56 pm
Location: Appalachia
Contact:

Re: Strange Performance Issues

Post by tentus »

There's an article that I can't seem to find again about how game framerate costs are not constant. We think in terms of 1 object costing us 1 frame, but that's not really the case: the first object you add is going to have a tremendous cost, as will the second, but the more objects you add the less they seem to hurt your framerate. Its because the first object represents, say, a 200% increase in things to think about, the second being a 50% increase, and so on.

Attached is a shoddy little .love that can be used to illustrate what I'm talking about. Press up to increase the number of text layers, and down to decrease them.

My point is that don't be too surprised by a massive frame drop when you're fps is at 700. It will take you a while to chisel that down to below 60.
Attachments
fps.love
A fps demo.
(469 Bytes) Downloaded 203 times
Kurosuke needs beta testers
User avatar
Simtex
Prole
Posts: 39
Joined: Sun Dec 14, 2008 5:31 am

Re: Strange Performance Issues

Post by Simtex »

tentus wrote: My point is that don't be too surprised by a massive frame drop when you're fps is at 700. It will take you a while to chisel that down to below 60.
I understand what you are saying, and you are certainly correct that the first couple objects are the biggest hits to performance, and adding more is a non-linear performance hit. I do see that kind of behavior, and would be okay with it if it leveled off at a reasonable place, but something else seems to be up here.

I went ahead and printed out the LOVE readme.txt using the following code, my fps dropped to 20-22.

Code: Select all

test1 = [[
LÖVE is an *awesome* framework you can use to make 2D games in Lua. It's free, open-source, and works on Windows, Mac OS X and Linux.

RUNNING GAMES
-------------

In Windows or other graphical enviroments, just open the .love file you want to 
run with the love binary, such as love.exe. (~^-^)~

In a console, type "love" followed by the relative or absolute path to a directory 
(or archive).

Examples: 

* love mygame.love
* love /home/hax/ultragame

Remember that what you are trying to run at least should contain the file "main.lua". 

Compilation
-----------

Windows:
	Use the project files for Visual C++ 2008 or 2010 (2010 preferred) located in the platform dir.
*nix:
	Run platform/unix/automagic, then run ./configure and make.
OSX:
	Use the XCode project in platform/macosx.


! WARNING ! 
-----------

This software is not complete. This is just a preview. Don't expect to find any 
interface consistencies between releases at all. With each release, everything 
you once knew and loved may be brutally murdered. By which I mean removed and/or 
changed.
]]

function love.draw()

	love.graphics.print("FPS: " .. love.timer.getFPS(), 50, 20)

	love.graphics.print(test1, 0, 40)

end
User avatar
bmelts
Party member
Posts: 380
Joined: Fri Jan 30, 2009 3:16 am
Location: Wiscönsin
Contact:

Re: Strange Performance Issues

Post by bmelts »

Well, the fact that text rendering is awful and slow in 0.7.2 doesn't really help matters there.
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 3 guests