Node:getChildren()性能问题 #2074
-
试例代码如下:
程序满帧率被设置成60 |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments
-
Have you tried running the Time Profiler Instrument in Xcode to find out what section of code is causing the performance issue? |
Beta Was this translation helpful? Give feedback.
-
I'm not sure what that LUA method does, but perhaps someone else with knowledge can help with this. A possibly work-around is if you keep track of the children outside of that scheduled method, you wouldn't need to call Also, which version of Cocos2d-x are you comparing Axmol to? v3.17, or v4? Other than that, I'm curious about this section of code (check the comment please):
Would this be better:
|
Beta Was this translation helpful? Give feedback.
-
用于测试,写的有点不严谨
axmol lua 2.1.4 消耗了2.92s,用cocos2d lua 4.0版本消耗0.07s,这两个运行环境是一样但差距有点大呀,能力有限有没有大神看看哪里出问题了? |
Beta Was this translation helpful? Give feedback.
-
#332, maybe GC 模式设置错误,请检查下 |
Beta Was this translation helpful? Give feedback.
-
以前的项目修改了GC模式,现在项目迁移,没发现这个还能导致性能问题 |
Beta Was this translation helpful? Give feedback.
以前的项目修改了GC模式,现在项目迁移,没发现这个还能导致性能问题
在启动lua的时候设置
collectgarbage("setpause", 100)
collectgarbage("setstepmul", 5000)
去掉,问题一下子解决了
非常感谢