Titanium Community Questions & Answer Archive

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

My App is Dog Slow on the iPhone 4

I recently put an app on my iPhone 4, and I'm appalled at how much slower it is on the device as compared to the simulator.

There are two things, in particular, that are slow.

First, the pages have a delay before getting rendered. All they have are some labels and textFields. I'm using JS includes throughout, so I wonder if that's an issue.

//Window 1
var win1 = Ti.UI.createWindow({  
   title:'Flight Plan',
   backgroundImage:'images/app-background.png',
   barColor:'#000',
   url:'includes/window1.js',
   translucent:true
});

The second thing that's slow is my scroll views. I'm assembling them like this inside window1.js:

var win1 = Ti.UI.currentWindow;

var scrollView1 = Ti.UI.createScrollView({ 
   contentWidth:'auto', 
   contentHeight:'auto', 
   top:0, 
   showVerticalScrollIndicator:true, 
   showHorizontalScrollIndicator:true 
});

var view1 = Ti.UI.createView({ 
   left:0, 
   right:0, 
   height:'auto', 
   top:0
});

scrollView1.add(view1);
win1.add(scrollView1);

Any ideas on what I might be doing wrong? Any ideas on how I can discover what's causing the poor performance?

Thanks!

— asked August 7th 2010 by Clifton Labrum
  • includes
  • performance
  • slow
  • sluggish
  • view
1 Comment
  • Did you have any resolution to the slowness?

    I'm about ready to throw in the titanium towel. My simple app is dog slow to the point of being unusable.

    — commented November 28th 2011 by Cord Awtry

2 Answers

  • "I'm appalled at how much slower it is on the device as compared to the simulator."

    If your simulator is slower than a handheld, you probably have a very slow computer. :) Native Objective-C or 3rd party-interpreter, your app will run much slower than the simulator, that's normal and that's why you always test on a variety of devices first for usability.

    Ps, if you think it's slow on iPhone 4, try earlier models.

    — answered August 7th 2010 by Daniel Lim
    permalink
    1 Comment
    • He said it's slow on the device, not the simulator. Not sure how older devices being even slower helps?

      — commented November 16th 2010 by Ingmar Koecher
  • I'm having pretty much exactly the same problem. Scrollviews that are not complex run fine in the simulator, and very slow on the device.

    — answered November 16th 2010 by Ingmar Koecher
    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.