Mobile web apps may be slow because Moore's law is ending(techcrunch.com) |
Mobile web apps may be slow because Moore's law is ending(techcrunch.com) |
Even on "heavy" JS apps, I've heard it said they only use 30% CPU. So if 70% time is not spent in JS, even if you run that 30% 50 times faster, at best you get a 42% speedup from 50 times better CPU performance.
I feel the author has caused many to have the wrong take-away message, and the anti-web contingent are lapping it up. Mobile Wep Apps can be made to perform fast today, but it takes way way too much effort to tweak the CSS/DOM manipulations to avoid jank. Consider for example the need to manually "hint" you want GPU compositing by using identity CSS3 transforms.
The rendering engines need to get better with leveraging the GPU and avoiding work when they don't need to.
If you want to see what a herculean effort can achieve, see Sencha's FastBook.
Basically, the author is right, but I think it's a red herring given that when people talk about "slow mobile web apps", 99% of the time, they are not talking about an Instagram written in JS, or AngryBirds in Javascript, but some basic news feed app.
Why do you need virtualization if the code is Java bytecode? Sure, this doesn't work for iPhone, but Android should be able to easily change the processor architecture. (If I'm not missing something here). There's already Android-x86 project.
I was expecting some kind of snark, but not this. I'm glad I suffered through the page crashing my iOS browser once.
Our current progression with silicon based computing is slowing because we're reaching the physical limitations of that technology.
What actual proof does this dude have that pocket-sized computers have reached their limits of performance and memory?
All I see are some carefully selected quotes from some "hardware engineers" who are doing nothing more than offering up their opinion.
An "ex-Intel engineer" and a "robotics engineer" have a single paragraph. Really, this is your research? Some anonymous quotes, probably taken out of context?
> I have consulted many such qualified engineers for this article, and they have all declined to take the position on record. This suggests to me that the position is not any good.
Really.
Do I have to go on?
If you want a consistent 60 frames a second, you need to architect systems that complete the work that needs to render each frame within 16.6ms. If you can't complete all your computations within 16.6ms, you need to prioritize computations and spread them across frames.
I don't know if this affects JS ability to render it but it is at least my experience that JS based apps are simply not able to give me the same non-interupted feel as natively build ones, this includes even apps like RSS readers.
1. Do computation locally on local data, thus avoiding round-trips to a far away server.
2. Distribute an app to lots of people without having to pay for a lot of server resources to match, since the computation is done on each user's device.
3. Enable users to keep more data private, by keeping it on the user's own device.
Isn't the obvious solution to avoid garbage collection whenever possible? Just consider 'Date.now()' vs 'new Date().getTime()' - are we even trying? Shouldn't we start considering unnecessary garbage a bug, like a memory leak? That might not change everything, but it surely would help, no?
If we really start hitting these kinds of walls, I think that Javascript subsets (like asm.js) will become more prominent, but it's an interesting idea.
But people still need to be aware of it first; making new objects for one time use is handy, and the normal way to go about things. It's certainly the default way tutorials tell you to get the time (even in game loops). At least personally, before today I didn't even know about Date.now(), and I never saw a discussion about any of this stuff in regards to libraries (how good or sloppy they are with GC)... it just doesn't seem to be on the radar, outside of gamedev. And by the time stuff gets sluggish by the accumulated little objects here and there, there is no easy fix, other than a whole lot refactoring or rewriting from scratch with it in mind.
'Our world is coming to an end.' Gotta love it.
Could you quote the part where the author of this article or the original Why mobile web apps are slow article say that we have reached a hard "limit of performance and memory", because I don't see where they say that at all.
The article I'm reading says this:
Unchecked exponential growth has to end sometime, by definition, and this is how it would happen; not with a bang, but with a whimper. We won’t hit a wall, we’ll just…start…to…slow…down.
What actual proof does this dude have that performance and memory of pocket-sized computers have started to slow down?
And how does arguing this point have anything to do with his overall "thesis"?
Forest for the trees, man, forest for the trees...
For example, author answers the question "how does JS performance compare to native performance exactly?" by takinig a random benchmark from the benchmarks game. What I was hoping for was comparison with desktop browser in
- dom manipulation
- canvas
- css animation performance
There are different problem domains, each requiring different kind of performance. The randomly picked benchmark is probably the one that is most removed from real world usage.And from my personal experience, the worst performance bottlenecks in mobile JS apps are in DOM rendering and manipulation, not in raw JS speed. But my problem domain isn't games and image processing: instead it involves news reader, presentation editor, GPS tracking, tiled map rendering, exercise diary and stats app, and an app that makes Google Docs run on the iPad.
Interestingly enough, all iOS devices younger than iPhone 4 can do all of the above smoothly, even in a WebView where supposedly nitro is disabled, while the WebView on Android devices stutters and struggles to achieve 30 FPS, sometimes going down to 2-3 FPS even on modern devices and the latest version. So really, the raw JS performance already doesn't matter for my usage cases.
Its the variable rendering performance and behavior of Android's WebView that is the main problem. As soon as you think that you've found a solution to a certain rendering speed problem that works across all Android devices, a new version of Android appears on a certain device and invalidates that assumption by being slow as molasses in January.
Another example that makes it hard for me to take this article seriously:
"It’s slower than server-side Java/Ruby/Python/C# by a factor of about 10"
How can he claim this with a straight face? Java itself is faster than Ruby by a factor of 10 - can he try to be a bit more accurate when making claims?
I agree with one statement of the article, however. "Let’s raise the level of discourse". However, this article doesn't do that at all.
[1]: http://sealedabstract.com/rants/why-mobile-web-apps-are-slow...
The most glaring issue was probably the garbage collection performance graph: He picked out the performance of mark and sweep collectors to make a bold statement about memory usage necessary for performance, and completely ignored the data for the generational collectors for that statement.
This is not to say that garbage collection is a non-problem in mobile applications (it can be, but the argument for why is trickier and is not easily translated into soundbites), but somebody flat-out ignoring data does not inspire confidence.
The big problem is that the author doesn't ever seem to have seen a compiler from the inside, yet makes sweeping statements about programming language technology that simply aren't borne out by fact.
There's a lot of interesting work on memristor memory, which is much cheaper and faster (and probably lower power) than RAM ,And a lot of interesting work on faster, lower power 3D memory interfaces.
Those and other hardware innovations could have a huge effect on the garbage collection issue, and this whole debate.
http://browser.primatelabs.com/ios-benchmarks
(The iPhone 5 is 2.5x faster than the 4S and 12x faster than the iPhone 1)