Text Size

iPhone slow to run Javascript?

updated 10:50 am EDT, Fri August 17, 2007

iPhone Javascript slow?

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.

 
Previous Comments

WTF do you expect?...

08/17, 11:00am reply

It's a bloody PHONE, not a dual-core desktop machine.

hybrid

Fresh-Faced Recruit

Joined: Apr 2004

0

Also...

08/17, 11:02am reply

Java is not Javascript and vice-versa.

hybrid

Fresh-Faced Recruit

Joined: Apr 2004

0

Comparison

08/17, 11:24am reply

My laptop is not as fast as an 8 Proc Intel XEON server...please make it faster.

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.

dynsight

Fresh-Faced Recruit

Joined: May 2005

0

cray-z

08/17, 11:57am reply

Has anyone done any research to see if the iPhone processor is as fast as a Cray super computer?

Is Apple trying to pull the wool over our eyes?

coldfusion1970

Fresh-Faced Recruit

Joined: Nov 2004

0

Err...

08/17, 12:32pm reply

I think you fellas are utterly and completely missing the point. The problem has 2 parts:

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.

dogzilla

Mac Enthusiast

Joined: Sep 1999

0

@dogzilla

08/17, 12:41pm reply

I couldn't agree more. If you are telling developers that web apps is the way to get on the iPhone, particularly via AJAX, then having a dismal javascript implementation is not acceptable.

lockhartt

Fresh-Faced Recruit

Joined: Apr 2000

0

Poorly written...

08/17, 12:48pm reply

If the issue isn't iPhone vs. Desktop performance, then the report should have said what you did... simply that Javascript performance on the iPhone is unacceptably slow.

Comparing it to a desktop machine just confuses the issue.

hybrid

Fresh-Faced Recruit

Joined: Apr 2004

0

idiotic MacNN editor

08/17, 01:01pm reply



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!

ZinkDifferent

Fresh-Faced Recruit

Joined: Jan 2005

0

Java just sucks

08/17, 01:08pm reply

Bottom line: Javascript sucks...always has...probably always will.

Mr. Strat

Fresh-Faced Recruit

Joined: Jan 2002

0

N800 Javascript Faster

08/17, 01:41pm reply

http://soandsuch.blogspot.com/2007/08/n800-javascript-faster-than-iphone.html

Sondjata

Fresh-Faced Recruit

Joined: Oct 2000

0

Popular News