Update: the content of this post is no longer relevant. The gap has been filled.
Last week there were some discussions about the poor performance of jQTouch in PhoneGap apps, so I dug into it.
First I had to verify that this was something we were doing in PhoneGap and not a difference between Mobile-Safari and the UIWebView control which we use in PhoneGap.
I created a PhoneGap project and dropped the jQTouch sample code into the www folder, and immediately noticed the sluggish performance.
I then created a bare bones iPhone Windowed application with a UIWebView in it, and dropped the same www folder contents into the project root.
NSURL *appURL = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"index" ofType:@"html" inDirectory:@"www"]];
NSURLRequest *appReq = [NSURLRequest requestWithURL:appURL cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:20.0];
After running both builds on the device it was obvious that the PhoneGap version was in fact sluggish compared to the bare-bones version. Verified!
Okay, so commenting it out isn’t really a solution, so here is the plan:
If your application does not use the accelerometer, instead of commenting out the code like I did, you can simply set “EnableAcceleration” to false in PhoneGap.plist.
I will post an update here when I have checked in anything of significance.