I am surprised at just how much faster the iPhone is than the next nearest Google device (a laptop). I haven't used an Android device for a long time, but I hear the "Apple is overpriced" so often that I assume someone has been checking this out.
Actually this is probably thanks to Safari's JS engine. From the graph [1] it seems that Safari is roughly 3x faster than Chrome parsing and compiling JS code on the same Macbook Pro.
Yeah, Safari has stupidly fast startup times compared to Chrome. It's one of the big things that they are working on in their engine.
It's been a bit, and I'm going from memory here, so forgive me if i'm wrong, but...
V8 is introducing a new "interpreter" mode to help here so that the page can start being interpreted ASAP and no JIT overhead needs to force the system to wait until it's done a first pass. And in the long run they want to pull out 2 of the JITs in their engine to simplify the process and speed up the first execution (along with reducing memory usage, and simplifying the codebase to allow for faster and easier additions and optimizations).
It's a great move, but it means that things are going to get slightly worse before they get better.
The "old" V8 had 3 compilers, "Fullcodegen", "crankshaft", and "turbofan" [0]. The current V8 has those 3 + Ignition [1], so it's just adding more on now. But over time they will be removing crankshaft and fullcodegen and it will leave them with a really clean and fast engine [2].
If anyone is interested, [3] is a fantastic talk on this and other plans they have for V8, and it's very accessible for those who don't know a thing about JS engines.
(sorry about the links to google sheets here, it's the only place I can seem to find the infographics)
I am not aware that Edge is "stupidly fast" on startup. Safari though, is indeed currently leading the field.
As you correctly outlined, V8 is indeed transitioning to a world with an interpreter+optimizing compiler only. If you are using Chrome Canary, there is a chance that you are already using the new pipeline :-).
> As you correctly outlined, V8 is indeed transitioning to a world with an interpreter+optimizing compiler only.
ECL and CLISP both settled on this model. CLISP started out as a bytecode interpreter and added GNU Lightning for native code generation. ECL started out as a source-to-source compiler to C and added a bytecode interpreter; both follow C calling convention as much as possible, at first for easy interop with C code and then for easy interop for the bytecode interpreter, which avoids the C++ interop problems mentioned in the talk.
From those who spoke at BlinkOn about Ignition, it sounded like some of the pushback had been about Octane, but there'd been some movement against worrying about the Octane regression from a view that Crankshaft was over-fitted to Octane.
How much of what's remaining is performance versus stability/correctness?
iPhones aren't simply faster at JS, they're faster at everything. Benchmarks run in the same app always come out drastically in the iPhone's favour.
Granted, this isn't a strict apples-to-apples comparison, but the differences are so drastic and always in Apple's favour. That, combined with the actual, physical differences in speed of the processors on the phone itself, indicates that it's not just Safari.
Yeah, and that's becoming quite an old thread (2015), yet the most recent comment is from Nov 2016, and if you read backwards from there it's a pretty strong indicator that the issues are still extant. It's a real PITA. My soon to be replaced (but I like the small form factor a lot) iPhone 5S from 2013 whups the ass off my OnePlus Two from early 2016 when it comes to JS and canvas rendering performance.
I've been a mac user for a few years and this year switched back to iPhone as well. I figure if JS developers don't want to address the speed issue[0], I might as well invest in a company that will.
[0] They are always too busy saying, "Just use React".
Apple have actually put effort into improving single-threaded performance. Whereas competing Android handset manufacturers have wasted effort on a internecine MOAR CORES = BETTER!!! marketing fight.
That honestly isn't the reason I got an iPhone, but you raise an excellent point: for a 600x improvement in speed, and less advertising, one only has to pay 4x the price.