Your App Is Slow Because Our World Is Ending

The meatiest article I ran across on the Internet this week was also–maybe–a harbinger of doom for life as we know it. I mean Drew Crawford’s superb piece Why mobile web apps are slow. It’s long, and somewhat dense, but definitely worth reading if you’re technical enough to follow along.

Its upshot: HTML5 apps will be vastly inferior to native apps not just for the next year or two, but for the next 5-10 years, because of fundamental technical limitations inherent to mobile platforms. I do have a quibble or two2 with some of his arguments, but he has convinced me that two pieces I wrote two years ago, in which I call for iOS garbage collection and claim that HTML5 will rule over all in a few years, may need to be reconsidered in light of new evidence.

All right, OK, fine, I’ll say it: they were just plain wrong. To be fair, my call for garbage collection puts me in good company, including programming god John Carmack

— but I’m now pretty convinced that HTML51 is not a short- or even medium-term solution for any kind of genuinely nontrivial iOS app, and I’m pretty dubious about other platforms too.

When you start thinking about the root causes, though, it gets even more interesting and/or downright apocalyptic. Crawford writes early on:

The solution is obviously just to make ARM 10x faster, so it is competitive with x86, and then we can get desktop JS performance without doing any work! Whether or not this works out kind of hinges on your faith in Moore’s Law in the face of trying to power a chip on a 3-ounce battery.

–which caught my eye, because of late I’ve noticed a spate of other articles warning that “we’ve been falling behind Moore’s Law ever since Intel hit the power wall back in 2005,” to quote Linley Gwenapp.

It is no exaggeration to say that Moore’s Law has been the single most important and powerful force in our world for fifty years now. It is the reason that “technology, whether you like it or not, is the dominant economic and cultural force of our time.” So this is kind of a big deal.

But ask AMD; ask Broadcom; a considerable amount of evidence seems to indicate that over the last few years, at least on a bang-per-buck basis, the breakneck exponential growth in computing power that has propelled the technology industry as we know it, and transformed the entire world and the lives of every single human being…is finally slowing down.

Granted, people have been predicting its end for decades, and somehow it has just kept trucking along–which is nothing short of astonishing–but now we seem to now be trapped between the Scylla of heat and power dissipation on one side and the Charybdis of fundamental quantum limitations on the other. While various new breakthroughs have been mooted, and some of them may actually pan out, let’s not forget that Moore’s original formulation of the law referred to “the number of components per integrated circuit for minimum cost.” It seems reasonable to be skeptical that these new approaches will give us anything like the value-for-money that we’ve come to expect.

What we have grown to think of as normal — that every couple of years, technology gets an order of magnitude faster and/or smaller and/or cheaper — is actually, when you stop and think about it, incredibly freakish and crazy. 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. And we’ll see it happen first on the most hardware-constrained devices, which is to say, for most people, on our phones.

When the history of humanity is written, I expect the past fifty years will be known as the Mooreic Era. And now we may finally be witnessing the beginning of its end. This doesn’t mean progress will stop; even in the worst case, the shockwave from fifty years of skyrocketing technnical growth will echo through all of humanity and everything we do for some decades yet. And it’s entirely possible that Ray Kurzweil and the Singularitarians are right, and that Moore’s Law will be prolonged or replaced by something even more insane. But it’s also possible that we are finally coming to the end of the fastest-changing era in the history and the future of humanity.

If so, then generations to come will look back on the time period from 1963 to, well, today-ish, and sigh wistfully “That must have been the most exciting time in all of history to have been alive.” Joke’s on them, maybe. But just on the off chance that this ride is coming to an end, let’s all try to enjoy it while we can.

Image credit: Doomsday clock, Marca Pasos, Flickr.

1in the sense of “HTML5 markup, CSS3, and Javascript”

2 One of his key points is that “when garbage collection has five times as much memory as required, its runtime performance matches or slightly exceeds that of explicit memory management” but “in a memory constrained environment garbage collection performance degrades exponentially.” The obvious solution, then, is to throw memory at the problem, no? Android has garbage collection, iOS does not: that’s probably why a $299 Nexus 4 has twice the RAM of a $649 iPhone 5, and Android phones with 4GB of RAM may well become available later this year. Still, his larger point stands; JavaScript is fundamentally incompatible with memory-critical apps.