Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Different application startup time — Gideros Forum

Different application startup time

chipster123chipster123 Member
edited April 2012 in Bugs and issues
I'm building an app and running the .apk on two different Android devices. The time between gideros splash and my app's main screen is LESS on my old OG Droid than it is on the Samsung Galaxy Nexus. 7 seconds faster.
Specifically, in a side by side test, it takes about 9 seconds from Gideros splash to the app's main screen on Droid and 7 more seconds until the app's main screen appears on the Galaxy Nexus.

Any ideas?
Tagged:

Comments

  • alexzhengalexzheng Guru
    edited April 2012
    It takes about 3 or 4 seconds on my nexus S.
  • atilimatilim Maintainer
    Uhh 9+7 seconds is really long. The splash screen takes 4.5 seconds. How about running your code on android player? Also it takes that long?
  • @atilim, It takes less than 2 seconds from hitting the blue "start" triangle to when the main app screen pops up on the player running on the Galaxy.
  • chipster123chipster123 Member
    edited April 2012
    I added a time stamped log() function to write trace points to "|D|logfile.txt"
    Here's where the difference is

    On Galaxy Nexus
    09:40:47 - Loading Fonts
    09:40:48 - Done Loading Fonts
    <b>09:40:57</b> - Creating sceneManager
    On OG Droid
    09:46:59 - Loading Fonts
    09:47:00 - Done Loading Fonts
    <b>09:47:04</b> - Creating sceneManager
    So, the time hog is somewhere in one of the many files in the project that gets executed automatically before the main.lua gets executed.
    Getting closer ...
  • Narrowed it down to my inefficient implementation on loading fonts. After re-arranging how the fonts are handled, the times dropped to about 3 seconds from gideros splash screen to main app display. (There were more font loading locations than the above traces show)

    It did highlight that there must be some difference in the way my two phones handle loading fonts. I would have thought that ICS would be better than FROYO, but there are so many other variables that I can't make appropriate conclusions.
  • Can you give us some info regarding what you did previously and what you did to speed up the font loading, it might help others from falling into the same trap.

    Cheers!
    WhiteTree Games - Home, home on the web, where the bits and bytes they do play!
    #MakeABetterGame! "Never give up, Never NEVER give up!" - Winston Churchill
  • chipster123chipster123 Member
    edited April 2012
    OK. In a nutshell, I load the font once, and pass the reference to all the calls to TextField.new() When I summarize it like that, it seems pretty obvious, but there are layers of code that made me forget that was happening

    Long story: I have a poorly implemented keypad for testing on PC Player and Android (until a keypad becomes available within Gideros for the player, and until I figure out how to hook into the native Android UI keyboard).
    The home-grown keypad was calling TTFont.new() for every key during initialization.
    That's every alphanumeric and symbol! Unlike Texture.new(), I don't think TTFont.new() realizes when it loads the same font and size multiple times to increment a reference count. It looks like it loads multiple resources every time. Not sure.

    So, I changed the keypad class to be passed a pre-constructed font in its .init() instead of the font name, and use the font in all the calls to TextField.new(font, textStr).
    I lost a little customization for making some key letters smaller fonts than others, but this is only a temporary hack to allow keypad entry.

    Hopefully this explains my mess and how I got out of it.

    Likes: techdojo

    +1 -1 (+1 / -0 )Share on Facebook
  • Glad you realised where you were going wrong, it just goes to show though even monkeys can fall out of trees :)

    Likes: chipster123

    WhiteTree Games - Home, home on the web, where the bits and bytes they do play!
    #MakeABetterGame! "Never give up, Never NEVER give up!" - Winston Churchill
    +1 -1 (+1 / -0 )Share on Facebook
Sign In or Register to comment.