performance too LOW!
Re: performance too LOW!
Perhaps it's better to put it this way: if you need that kind of performance, then Löve is probably not the right tool to use.
My game called Hat Cat and the Obvious Crimes Against the Fundamental Laws of Physics is out now!
Re: performance too LOW!
I do not quite see what you want with this thread zzz654321. If you think that Löve has too low "performance" and think that something else is better, then by all means do use that.
There are a lot of big and ambitious projects that have been made in Löve that do not suffer from performance issues related to the framework itself.
There are a lot of big and ambitious projects that have been made in Löve that do not suffer from performance issues related to the framework itself.
Re: performance too LOW!
I am guessing you do not use sprite batches, and without using sprite batches on drawing stuff I think it is quite useless test. I am almost sure that you are more likely gonna be bounded by your gpu rendering unit, than LUAs performance. Also saying that you have 5000 polygons on your phone and 5000 on cocos animated doesn't excatly tell what you're even measuring. 5000 draws per frame? Per minute? 60 frames per second?
With same note I do manage to draw 12k quads per frame on 60 frames per second on my phone with sprite batches, but even that is terrible for measuring performance, since it also depends on quads size. The thing is that most of the quads are discarded since they try to draw same pixel multiple times.
Maybe the whole topic is april fools joke?
With same note I do manage to draw 12k quads per frame on 60 frames per second on my phone with sprite batches, but even that is terrible for measuring performance, since it also depends on quads size. The thing is that most of the quads are discarded since they try to draw same pixel multiple times.
Maybe the whole topic is april fools joke?
Re: performance too LOW!
(I know some of these tips do not apply in this case but I listed all my tips anyway )
Performance tips:
1. only draw what's visible on screen (even if the the object isn't visible the GPU still process it, so do a check)
2. remove any unused object on screen
3. use LUA optimizations ( http://www.lua.org/gems/sample.pdf )
4. compressed textures can seriously improve performance (especially load times and VRAM usage) you can use this tool to do it: http://pnggauntlet.com/
5. if you have alot of CPU calculations multithreading might be an option (https://www.love2d.org/wiki/love.thread)
6. when checking FPS don't do as the wiki says:
Wiki method:
Correct method:
7. also avoid using "love.graphics.setColor" inside loops if possible because it seriously cripples FPS
and a small note: I actually agree Löve could use some optimization HOWEVER it is far from unusable in most cases
Performance tips:
1. only draw what's visible on screen (even if the the object isn't visible the GPU still process it, so do a check)
2. remove any unused object on screen
3. use LUA optimizations ( http://www.lua.org/gems/sample.pdf )
4. compressed textures can seriously improve performance (especially load times and VRAM usage) you can use this tool to do it: http://pnggauntlet.com/
5. if you have alot of CPU calculations multithreading might be an option (https://www.love2d.org/wiki/love.thread)
6. when checking FPS don't do as the wiki says:
Wiki method:
Code: Select all
function love.draw()
love.graphics.print("Current FPS: "..tostring(love.timer.getFPS( )), 10, 10)
end
Code: Select all
function love.update()
FPS = love.timer.getFPS( )
end
function love.draw()
love.graphics.print("Current FPS: "..tostring(FPS), 10, 10)
end
and a small note: I actually agree Löve could use some optimization HOWEVER it is far from unusable in most cases
- slime
- Solid Snayke
- Posts: 3163
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: performance too LOW!
Compressed textures are formats like DXT5. That tool just creates a PNG, which still has to be decompressed when it's loaded (it's not a Compressed Texture.)jjmafiae wrote:compressed textures can seriously improve performance (especially load times and VRAM usage) you can use this tool to do it: http://pnggauntlet.com/
Both of your snippets of code do essentially the same thing, performance-wise. love.timer.getFPS doesn't even do any calculations on its own, it just returns a variable, so it's one of the cheapest love functions to call.jjmafiae wrote:when checking FPS don't do as the wiki says
setColor is also very cheap (although not quite as cheap as getFPS or getWidth / getHeight.) Calling it before a draw call won't have a significant performance impact, compared to not calling it.jjmafiae wrote:avoid using "love.graphics.setColor" inside loops if possible because it seriously cripples FPS
The most important performance tip is to profile your code, and figure out where your bottlenecks are and whether you even need to optimize anything at all.
http://blogs.msdn.com/b/shawnhar/archiv ... guess.aspx
Synthetic benchmarks often don't tell you anything useful about how something will perform in real-world situations, since they tend to do things that would never happen in real-world situations.
Re: performance too LOW!
from my own testing my games ran faster after moving the love.timer.getFPS check out of love.draw()slime wrote: Both of your snippets of code do essentially the same thing, performance-wise. love.timer.getFPS doesn't even do any calculations on its own, it just returns a variable, so it's one of the cheapest love functions to call.
Re: performance too LOW!
Did you perhaps modify love.run? If not, take a look at the default one: https://love2d.org/wiki/love.run love.update runs just before love.draw, once per frame, so it shouldn't really change anything by just moving the getFPS call from one of them to the other.jjmafiae wrote:from my own testing my games ran faster after moving the love.timer.getFPS check out of love.draw()slime wrote: Both of your snippets of code do essentially the same thing, performance-wise. love.timer.getFPS doesn't even do any calculations on its own, it just returns a variable, so it's one of the cheapest love functions to call.
My game called Hat Cat and the Obvious Crimes Against the Fundamental Laws of Physics is out now!
- Jasoco
- Inner party member
- Posts: 3726
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: performance too LOW!
Why? The cost for calling getFPS couldn't be that high. Plus you're still calling it every frame anyway. That's what it's for. Getting the FPS every frame.jjmafiae wrote:6. when checking FPS don't do as the wiki says:
Wiki method:Correct method:Code: Select all
function love.draw() love.graphics.print("Current FPS: "..tostring(love.timer.getFPS( )), 10, 10) end
Code: Select all
function love.update() FPS = love.timer.getFPS( ) end function love.draw() love.graphics.print("Current FPS: "..tostring(FPS), 10, 10) end
Re: performance too LOW!
Yes but the problem is before the call was in love.draw() which is not meant to do that kind of calls, anyway what matters is that it works and it does at least in my testing.Jasoco wrote:Why? The cost for calling getFPS couldn't be that high. Plus you're still calling it every frame anyway. That's what it's for. Getting the FPS every frame.jjmafiae wrote:6. when checking FPS don't do as the wiki says:
Wiki method:Correct method:Code: Select all
function love.draw() love.graphics.print("Current FPS: "..tostring(love.timer.getFPS( )), 10, 10) end
Code: Select all
function love.update() FPS = love.timer.getFPS( ) end function love.draw() love.graphics.print("Current FPS: "..tostring(FPS), 10, 10) end
Re: performance too LOW!
Just because love.draw isn't meant for game logic, that doesn't mean you can't do calculations in it. Your little second step there even adds more of a hurdle because it's setting and retrieving global variable every frame, since you're so hellbent on being a stickler for the smallest increases in performance. In fact, this is probably the fastest possible way to do it:jjmafiae wrote: Yes but the problem is before the call was in love.draw() which is not meant to do that kind of calls, anyway what matters is that it works and it does at least in my testing.
Code: Select all
local getFPS = love.timer.getFPS
function love.draw()
love.graphics.print(getFPS(), 10, 10)
end
Who is online
Users browsing this forum: No registered users and 7 guests