
IOS 4.3 Nitro JS engine disabled for full screen apps and uiwebview - marcusramberg
http://www.mobilexweb.com/samples/nitro.html
======
naz
I think Hanlon's razor applies here. A lot of people will be slating Apple for
sabotaging non-native apps, but it's really just a bug.

~~~
benologist
Yes, it's bug #108978: Can't figure out where to extract 30% of revenue from.

~~~
alextgordon
How does making app store apps slower increase apple's revenue?

~~~
jrockway
It makes web apps (that work with any platform) slower, while native apps are
not penalized. That increases Apple's revenue because it will encourage people
to make native apps instead of web apps, which has a two-fold effect: one,
they get 30% of the app's revenue, and two, you have to buy an iPhone to use
it.

I'm sure it's a bug, but if it's not, it's not really a bad thing for Apple.

~~~
alextgordon
The issue affects UIWebView, which means it affects native apps too. Not quite
to the same extent, naturally, but the issue is there.

Perhaps Apple crippled UIWebView as some kind of plausible deniability, so
that they could go about their evil ways. /s

~~~
jrockway
Does Apple really want "native apps" that are really wrappers around web
content they don't control?

~~~
yaix
That sort of app would be called a "web browser".

~~~
cookiecaper
Right, and does Apple allow alternate web browsers? Last I knew they
disapproved anything that competed with an iPhone built-in app, like Google
Voice, which duplicated phone functionality.

~~~
paxswill
Yep. A couple I know off the top of my head are iCab and Opera.

~~~
ZeroGravitas
iCab and all other "browsers" on iOS are skins round the built in webkit. (It
would be interesting to see if and how they are effected by this bug).

Opera hasn't released its actual browser for iOS since doing so is banned by
Apple's policies. Same for Mozilla. What they have released is Opera Mini
which displays pages rendered by what is effectively a server-side browser.

~~~
jankassens
Apple took a long time to approve Opera, but they finally did:
[http://itunes.apple.com/de/app/opera-mini-web-
browser/id3637...](http://itunes.apple.com/de/app/opera-mini-web-
browser/id363729560)

~~~
ZeroGravitas
Their mobile browser is called Opera _Mobile_ , Opera _Mini_ is something
slightly different from a browser, for example it doesn't execute client-side
javascript.

------
geuis
To add another note to this, its a bug that Apple seems to know about. I can't
link to it because its marked CONFIDENTIAL across the top of the dev forums,
but in short its known about and being investigated.

------
buymorechuck
I suspect the reason is due to security concerns about running JIT executable
code in 3rd-party apps. I have a harder time understanding full-screen web
apps, however. Those should be running within some kind of full-screen Mobile
Safari mode.

~~~
happybuy
Yes I believe when the SquirrelFish (now Nitro) JS engine was initially
announced that it relied on allowing certain items in memory to become
executable (most likely due to the JS interpretation and then execution) - and
that due to the security model in iOS and the ARM processors this was not
allowed.

In general I believe its good to not allow random bits of memory to become
executable as it can easily introduce a large number of security and memory
overflow vulnerabilities.

Perhaps as part of iOS 4.3, Apple has allowed Safari to circumvent this
restriction but not any other application. Which would make sense because they
control and are responsible for Safari, but to allow any application to
circumvent this restriction could open iOS up to large security issues.

~~~
blinkingled
>Perhaps as part of iOS 4.3, Apple has allowed Safari to circumvent this
restriction but not any other application.

Given Safari is the biggest attack surface and regularly falls prey to
exploits they should also disable the JIT for Safari. (Most iOS exploits like
the Pwn2Own ones, and jailbreakme.com ones are due to bugs in Safari.)

~~~
czhiddy
IIRC, the jailbreakme.com exploit relied on a flaw in libtiff.

~~~
blinkingled
Entry point was Safari though.

------
geuis
Some numbers for folks to examine based on 3x test of each state:

Non-fullscreen: 4094.5ms (test average) Fullscreen: 10528.2ms (test average)

~~~
geuis
A follow-up. I'm running sunspider on both my iPhone 4 w/ 4.3 and iPad v1 with
4.3 to get better numbers on this. I'm actually seeing my iPhone is 2x faster
than the iPad in completing this test. This seems odd...

~~~
geuis
Yes, what was odd was that the 4.3 update _started_ but hadn't finished when I
was running those tests. Merde. I'm updating my numbers.

------
some1else
I would paraphrase this to "Nitro JS not enabled for fullscreen apps and
UIWebView".

Their exact motives will be revealed when they announce whether they plan to
fix it or not.

Sure looks like a convenient bug though. In a sense, Microsoft probably didn't
intentionally loose to other browsers with IE6, it was just very convenient
for them to keep the entire web application ecosystem gimped for a few
releases of Office...

------
matclayton
Does apple actively want native apps to out perform html5? Of course, but
enough that would hinder the natural install points, seems a little crazy even
for apple...... is this the same on the iPad and iPhone/iPod?

~~~
Klonoar
You can't actively want what will always be. I love Webkit/et all, but people
need to get this through their heads that native will _always_ trump JS when
it comes to iOS development.

------
g-roc
it's a known issue to apple, several bug reports have been filed, so let's
wait and see (hope). it's pretty discouraging nevertheless. if you want to
confirm with the V8 benchmark, you can use my homescreen-enabled version
(version 5) here: <http://pavingways.com/test/v8-5/> \- numbers are around 230
in safari to only 90 as a homescreen app :(

------
zitterbewegung
I wonder what is the reasoning behind disabling the faster JS engine for full
screen apps and uiwebview?

~~~
ig0rskee
Does anybody have insights into general performance implications of using
UIWebViews vs Mobile Safari?

~~~
buymorechuck
There are several, but in particular, JavaScript seems to run 2X slower in
UIWebViews vs Safari. on iOS 4.3

