CCMenu/CCMenuItems Slow Performance

I’m working on a menu screen which happens to have 3 CCMenus with ~30 CCMenuItems in each. It’s a sliding menu so each, I suppose, ‘view’ has a single CCMenu that the user sees at a time. In any case, I have a lot of menu items. I noticed that when I load the scene (which only has the menu items) it takes about 8 seconds to load, which is way too slow. Naturally if I get rid of the other two menus (and ~60 items) then it takes maybe a second.

I was wondering if anyone has any tips for dealing with this or if this is a CCMenu only thing or a Cocos2dx kind of thing (with the number of items and all)? Or maybe if anyone has any tips for performance? I’m using the BB simulator and an Android Simulator, but on my BB tablet it’s about 8 seconds slow as well.

bumping this.

bumping again

Something I like to do is call ->setVisible(false) selectively on the things that aren’t being shown on the screen (write some logic), to reduce the draw calls.
I don’t have experience with either of those emulators but it’s possible the performance of the emulators is just poor (i’ve heard android emulation sucks). So i’d test on a real device if that’s an option for you.

Justin Godesky wrote:

Something I like to do is call ->setVisible(false) selectively on the things that aren’t being shown on the screen (write some logic), to reduce the draw calls.
I don’t have experience with either of those emulators but it’s possible the performance of the emulators is just poor (i’ve heard android emulation sucks). So i’d test on a real device if that’s an option for you.

It’s 8 seconds slow on a real device too. I’ll try to hide the menu items that are off screen and turn them on when the menu is selected and get back.

EDIT: So I tried this out and it only speeds it up by a second. I think it’s the number of items being added….

Some updates on stats:

  • 6-16 seconds to load the scene with all of the menu items and images
  • 0 seconds to load the scene without any menu items (but with images)
  • 1 second to create 4x3 = 12 CCLabelTTFs (not add)
  • 1 second to create 7x3 = 21 CCLabelTTFs (not add)
  • 5 seconds to create 26x3 = 78 CCLabelTTFs (not add)
  • 2 seconds to create 1 ‘view’ = 26 CCLabelTTFs

These are the rough stats I’ve found.