Page 1 of 3
performance too LOW!
Posted: Tue Mar 31, 2015 8:02 am
by zzz654321
love2s VS cocos2dx-lua, performance is too low!
What method can solve this problem?
Re: performance too LOW!
Posted: Tue Mar 31, 2015 8:27 am
by kikito
Without looking at your code, it is impossible to tell.
Re: performance too LOW!
Posted: Tue Mar 31, 2015 8:59 am
by arampl
Hmph. I even don't bother. If I'm after performance only, I'd use machine codes.
"For each Colonel there's General".
Re: performance too LOW!
Posted: Tue Mar 31, 2015 7:44 pm
by T-Bone
Löve's performance really depends on what you're trying to do. My experience is that Löve is fast enough to run more or less any 2D game even on crappy netbooks, as long as you code it right. It sounds to me like you're doing something stupid that's destroying your performance.
Or maybe you're running it on a Windows machine with poor OpenGL drivers?
Re: performance too LOW!
Posted: Wed Apr 01, 2015 5:17 am
by zzz654321
I under android and windows 2003
love2d project: 5000 triangle, ontimer move all triangle
cocos2dx-lua 2.2.5 project: 5000 polygon, animation.
love2d FPS is low.
Re: performance too LOW!
Posted: Wed Apr 01, 2015 8:07 am
by micha
Some time ago, I read an article about a performance comparison of LÖVE with some other game frameworks, and LÖVE performed slowest among the tested ones. Unfortunately, I don't have the link to the article at hand.
But the important question is: Is the performance only lower than in other frameworks, or it is "too low"? Have you actually tried to make a game and failed because of LÖVE's performance? Or did you just do a test and find that the framerate is lower and in Cocos2d? Because, if LÖVE is slower than other, but still fast enough, then there is no problem.
Re: performance too LOW!
Posted: Wed Apr 01, 2015 8:12 am
by kikito
zzz654321 wrote:I under android and windows 2003
love2d project: 5000 triangle, ontimer move all triangle
cocos2dx-lua 2.2.5 project: 5000 polygon, animation.
love2d FPS is low.
Do you need that many polygons in your game? Can we see the code you used?
Re: performance too LOW!
Posted: Wed Apr 01, 2015 8:54 am
by zzz654321
function love.mousereleased(x, y, btn )
for i= 1, 1000 do
--设置 x, y, 角度
table.insert(env_.items, { env_.width* math.random(),
env_.height* math.random(),
2* math.pi* math.random(),
} )
end
env_.MAX_ITEM= env_.MAX_ITEM+ 1000
end
function love.draw() -- GPU 计算
-- 2 关闭shader,矩形为默认效果
local w_= env_.width- env_.border* 2
local h_= (env_.height- env_.border* 3 )/ 2
love.graphics.setShader()
love.graphics.setColor(255, 255, 255 )
env_.xy(env_.border, env_.border )
love.graphics.rectangle('fill', 0, 0, w_, h_ )
love.graphics.pop()
-- 2 加载effect shader,矩形效果绚丽
if env_.effect then love.graphics.setShader(env_.effect ) end
env_.xy(env_.border, h_+ env_.border* 2 )
love.graphics.rectangle('fill', 0, 0, w_, h_ )
love.graphics.pop()
love.graphics.setShader() local j local strZH_CN_t1= ""
for i= 1, env_.MAX_ITEM do
env_.xy(env_.items[1 ], env_.items[2 ] )
j= env_.items[3 ] love.graphics.rotate(j )
j= 256* j/ (2* math.pi )
love.graphics.translate(env_.t* 16, 0 )
love.graphics.setColor(j, 256- j, env_.tick )
love.graphics.polygon("fill", env_.polygon )
love.graphics.pop()
end
if canvas then
love.graphics.setBlendMode('premultiplied' )
love.graphics.draw(canvas )
love.graphics.setBlendMode('alpha' )
end
if iconv then strZH_CN_t1= iconv("\n唉唉唉" ) end
env_.font28:setLineHeight(0.7 )
love.graphics.setFont(env_.font28 )
love.graphics.setColor(255, 0, 0 )
love.graphics.printf(string.format("%06d\n[%s]%s",
env_.tick, out_t1(), strZH_CN_t1 ),
220, 120, 300, nil, 0, 1 ) -- env_.t, 2 ) --
--love.graphics.setFont(env_.font28 )
--love.graphics.setColor(0, env_.tick, 0 )
--love.graphics.printf(
--string.format("%06d%s%s", env_.tick, strZH_CN_t1 ),
--220, 180, 200, nil, env_.t, 1 )
end
Re: performance too LOW!
Posted: Wed Apr 01, 2015 12:20 pm
by I~=Spam
kikito wrote:Do you need that many polygons in your game?
Yeah... exactly my same thoughts... real world tests are a better way to test any program. Unless you really need to render a few thousand triangles for your game... What features do you need to be fast?
Re: performance too LOW!
Posted: Wed Apr 01, 2015 4:38 pm
by adrix89
The answer is probably spritebatches.