Softpedia
 

NEWS CATEGORIES:



NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
Home > News > Apple

August 20th, 2007, 11:36 GMT · By Victor Mihailescu

iPhone Javascript Is Slow

SHARE:

Adjust text size:



Enlarge picture
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.
FILED UNDER:
Apple
iPhone
Javascript

TELL US WHAT YOU THINK:

2,492 hits · 1 comment · Link to this article · Print article · Send to friend · Subscribe to news

MUST-READ RELATED ARTICLES:


Apple Releases First iPhone Update

iPhone Sets New Standards for Mobile Internet

iPhone Embraced By Businesses, Changing The Web

READER COMMENTS:


Comment #1 by: Pino on 12 Feb 2011, 04:46 UTC reply to this comment

Desktop operating systems allow an application to write a block of machine code to memory and then run it. Most modern desktop web browsers use this to translate JavaScript loops into native code to run faster. But iOS has a security feature that does not allow a block of writable data to be executed as native code to make buffer overflow defects harder to exploit. Desktop operating systems often have the same security feature, but unlike them, iOS gives applications no way to override it. So iOS has no provision for just-in-time recompilation.

Copyright © 2001-2012 Softpedia. Contact/Tip us at

WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM