Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Ti App performance

Hi

I've been making some apps through Ti Appcelerator now. They seem to be working and flowing perfectly fine in the Emulator, but when running on device (iTouch 2nd gen) it's slooow as hell.

Is it because I'm building it wrong? Is it my iPod Touch just being slow? Or is Ti Apps just slower?

The apps I'm building aren't heavy.

Caspar

— asked August 10th 2010 by Caspar Jespersen
  • app
  • iphone
  • performance
0 Comments

4 Answers

  • Hi
    Yes, the ipod is slow ( I have one too :) )
    But there are optimisations you could do

    Do you use a className for tablerows?

    If you have multiple windows create the elements inside each window only when are needed.

    If you have elements displayed only once remove it after this.

    If you use sounds, after they are played and not needed anymore remove it

    Don't use transparency/opacity. Set each element backgroudColor if you have a solid color behind. Try not to use rounded corners.

    Don't use webviews if possible.

    Lots of "don't" :)

    — answered August 10th 2010 by Dan Tamas
    permalink
    2 Comments
    • Hi Tamas, I notice that you're all around answering questions on this forums - I want to thank you, it helps a lot! I see where you are going, it's all about trimming the app down to show only what's needed. However, I think Titanium should create some list with all of this on it.

      — commented August 10th 2010 by Caspar Jespersen
    • What is the method for removing elements from memory? Can you remove something and then have it added again if the user goes back to a certain screen?

      — commented August 26th 2010 by Todd Soligo
  • Well, there is a post around with tips and tricks that I started but seems not to have too much love from the developers :)

    http://developer.appcelerator.com/question/5291/tips-and-tricks-mobile—thread-to-share-some-experience-that-may-help-the-others

    ps. thanks for your kind words :)

    — answered August 10th 2010 by Dan Tamas
    permalink
    0 Comments
  • any advices on images?

    I've noticed for example that using imageViews with a size diferent from the original image is a slower operation (probably because of the auto-size).

    — answered August 10th 2010 by Pedro Sousa
    permalink
    2 Comments
    • If that's so, that answers lots of questions for me!

      — commented August 10th 2010 by Caspar Jespersen
    • Can a Titanium developer comment on this one? Is it better (for performance) to have different image files with different sizes or to scale the images to a different size within the imageView (thus have fewer image files to load)?

      — commented August 10th 2010 by Parijat Sahai
  • I try to bring the "best practice" from the web to Ti as much as possible.

    So I try to provide the images at the exact size, and optimised with this tool: http://imageoptim.pornel.net/

    Don't mind the url :)

    Less pixels and info to load, faster the imageView,

    I also try to avoid "auto" or to force the device to make the calculation

    So instead of:

    top:10,
    left:10,
    bottom:10,
    right:10
    

    I do:

    top:10,
    left:10,
    width:300
    height:460
    

    assuming a fullscreen mode( 320x480)

    use jpg where it's possible instead of png, and so on :)

    — answered August 10th 2010 by Dan Tamas
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.