Apple brought huge JavaScript performance improvements to Mobile Safari in March of this year, but those benefits didn't extend to Web apps saved to a user's home screen. iOS 5 will remedy that situation, however, finally putting home-screen Web apps on equal performance footing with those that run in the browser.
Apple brought its Nitro JavaScript engine to Mobile Safari as part of iOS 4.3. Nitro uses just-in-time compilation to dynamically convert interpreted JavaScript code into compiled native ARM code that runs as much as 2.5 times faster than interpreted code. The engine then changes the area in the memory where the native code is stored from writeable (for data storage) to executable (for code) to run the code directly.
Since Web-based applications rely heavily on JavaScript, Web apps running from within Mobile Safari got a significant speed boost form this improvement. Web apps saved to the home screen for direct access, however, did not. Those apps run in a separate process called Web.app, which wasn't able to take advantage of the Nitro engine.
Some speculated that Apple had done this deliberately to make Web apps seem like they perform worse than native apps. However, the difference ended up being credited to iOS's security model, which requires that executable code be digitally signed by the developer and verified by Apple.
"The way code signing works on the iPhone is that only pages [in memory] that come from signed applications can be executable," Charlie Miller, principle research consultant at Accuvant and iOS security expert, told Ars. "If an app tries to make a writeable page executable, it cannot. However, for JIT, this is exactly what you'd like to do."
Apple made a special exception for Mobile Safari to enable Nitro JIT compilation. In other words, Safari has special permission to generate code dynamically within protected memory and have that code executed by a device's CPU. In iOS 4.3 and higher, Web.app doesn't have the same permission. In iOS 5, though, it does. So, once iOS 5 is released to the public, all the Web apps that you have saved as icons on your home screen will run as fast as they do within Mobile Safari itself.