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!
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.
-
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.