love2s VS cocos2dx-lua, performance is too low!
What method can solve this problem?
performance too LOW!
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: performance too LOW!
Without looking at your code, it is impossible to tell.
When I write def I mean function.
Re: performance too LOW!
Hmph. I even don't bother. If I'm after performance only, I'd use machine codes.
"For each Colonel there's General".
"For each Colonel there's General".
Re: performance too LOW!
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?
Or maybe you're running it on a Windows machine with poor OpenGL drivers?
My game called Hat Cat and the Obvious Crimes Against the Fundamental Laws of Physics is out now!
Re: performance too LOW!
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.
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!
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.
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.
Check out my blog on gamedev
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: performance too LOW!
Do you need that many polygons in your game? Can we see the code you used?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.
When I write def I mean function.
Re: performance too LOW!
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
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
- Attachments
-
- cocos2dx-lua-2.2.5-benchmark.zip
- (223.18 KiB) Downloaded 320 times
-
- testProj.zip
- (12.18 KiB) Downloaded 300 times
Re: performance too LOW!
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?kikito wrote:Do you need that many polygons in your game?
My Tox ID: 0F1FB9170B94694A90FBCF6C4DDBDB9F58A9E4CDD0B4267E50BF9CDD62A0F947E376C5482610
Who is online
Users browsing this forum: aikusuuta, Semrush [Bot] and 12 guests