Incredibly slow...

Aug 20, 2007 11:36 GMT  ·  By

Although most iPhone independent developers are focusing on how to access more of the device's capabilities despite the difficulties placed in the way by Apple, as work progresses, more and more of them are turning towards practical things.

Craig Hockenberry observed that there were significant differences in the speed of some applications, depending on how they were coded. Specifically, he noticed that Javascript on the iPhone is rather slow. To verify, he ran some tests, and came up with surprising results. Running a simple beckmark on the iPhone versus a 1.83GHz, Intel Core Duo Mac, the results are staggering, with the iPhone being on average more than 80 times slower at executing Javascript functions. In some cases, the iPhone was over 90 times slower.

A logical assumption might be that this is normal, considering the fact that the iPhone is not as powerful a computer as a desktop Mac, and that it all comes down to processing power. That assumption however would be incorrect. To test what difference native code would make over Javascript, a single piece of software was made to run on the iPhone both in Javascript form and in Apple's native codebase. While the very basic functions were only seven to nine times faster in native code, things change quickly when moving up to divisions and function calls, where the speed difference is over 100 times faster and over 226 times faster, respectively.

It is obvious that Javascript is so much slower on the iPhone because of some other factor than the device's processing power. Regardless of the reason, it is quite clear that the web application approach, which relies heavily on Javascript is not the best way to go, and that native applications would be much faster. Hockenberry uses the numbers as yet another reason as to why Apple should come up with an SDK.