Author Topic: super slow app startup with NGUI  (Read 3350 times)

chickeyton

  • Guest
super slow app startup with NGUI
« on: June 24, 2012, 10:29:31 AM »
I build an unity 3.5 (xcode 4.02) game with NGUI UI in the first scene,  on my iPhone4 (iOS 4.3.3) it takes more than 20s to startup the release version to see the first scene, my iPad 1 (iOS 5) also take 15s to startup

I my pretty sure it is due to the NGUI framework, coz I tried delete the NGUI UI and reference all the related UI altas textures and draw it in OnGUI in the first scene,  the startup time of my iPhone4 drops to 7~8s only


the slowness only occur at the app startup, the loading time for switching scenes with NGUI is Okay, so I suspect it is the NGUI framework first time initializing problem.....

can anyone figure out the solution? Thanks!


chickeyton

  • Guest
Re: super slow app startup with NGUI
« Reply #1 on: June 24, 2012, 10:34:11 AM »
forgot to mention, I am using paid version 2.0.8

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: super slow app startup with NGUI
« Reply #2 on: June 24, 2012, 12:36:46 PM »
The size of NGUI's code is tiny, so that ain't it. Check the size of your atlas (or atlases, if you're using more than one).

chickeyton

  • Guest
Re: super slow app startup with NGUI
« Reply #3 on: June 24, 2012, 12:56:54 PM »
It is not related to texture but the Backward compatibility to BMFont that created with NGUI before the v1.84

Since I use the free version (v 1.68b) to build my game first, after I build most of the UI layouts, I brought the paid version and upgrade the code base directly without recreating the Font Asset and Altas,  The problem is v1.68b BMFont Serialize 65536 BMGlyph to the asset file, but in v1.84, it populate the old data to mSaved and mDict,  so it got hangs when startup

I recreated the existing font asset and fixed the problem, but it took me a whole day to locate the problem
« Last Edit: June 24, 2012, 01:02:47 PM by chickeyton »