08/17/2007, 10:50am, EDT
Friday, August 17th
iPhone slow to run Javascript?
A site makes the claim that the iPhone's handling of Javascript is substantially slower than that of desktop systems, and even the code used in Apple's native iPhone applications. Running a simple benchmark test of the iPhone versus a 1.83GHz, Intel Core Duo Mac, the iPhone is on average more than 80 times slower at Javascript functions, sometimes as much as 90 times. As further proof, a simple plotting app is said to provide a tangible end-user difference.
Performance differences are said to be even more radical when, through hacking (see the iPhone Dev Wiki), a single piece of software is made to run on the iPhone (download) in versions for both Javascript and Apple's native codebase. While some basic functions can be only seven to nine times faster in native code, this shoots up to over 100 times faster with divisions, and a dramatic 226 times faster when it comes to function calls.
The site's author uses these figures as a plea to Apple, asking the company to deliver a "real" SDK to developers. Apple currently limits third-party development on the iPhone to web-based services, using languages such as Java and Ajax; the benchmarking results appear to support Apple CEO Steve Jobs' view, which is that Java is a "ball and chain" for the device.
Filed under: Apple
,
, 12
,
,
,
,
,

subscribe to comments
for this article
I would be curious to see how the iPhone compares to other handheld devices (particularly phones) like the Curve, Blackjack, Palms, etc.
THAT would be a fair comparison.
Is Apple trying to pull the wool over our eyes?
1) Javascript is slow enough on the iPhone as to be broken for some web-based apps. This is most likely due to a bug or bad architecture decision in iPhone Safari. I suspect this can/will be fixed soon - Apple has always had problems with its Javascript engine. But until they do, or provide a real SDK, noone will develop anything serious for the iPhone since its JavaScript speed is so hideous.
2) The slow speed *is* a problem in that apps written for general consumption on the web have to be re-written for the slow iPhone javascript interpreter, and may not work, period. I suspect this is why there is a Google Maps widget as opposed to it just running in the browser: Google Maps in the browser would have been so slow as to be unusable. Not as if you can use the Map widget offline, so why is it a separate widget? Problem is, without an SDK, the only people who can make their javascript-heavy apps usable are those that have been "blessed" by Apple.
Nobody cares about the comparison between a desktop and iPhone version - they only care about the comparison between native widgets and web apps.
Comparing it to a desktop machine just confuses the issue.
JAVA and JavaScript are two entirely different technologies, not even remotely related.
At least if you have to hire illiterate monkeys as your editors, get some that at least peripherally know the technologies they are writing about - dumb morons!