3 ms·
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
by Klathmon 10y ago
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)
[0] https://docs.google.com/presentation/d/1OqjVqRhtwlKeKfvMdX6HaCIu9wpZsrzqpIVIwQSuiXQ/edit#slide=id.g1453eb7f19_0_359 https://docs.google.com/presentation/d/1OqjVqRhtwlKeKfvMdX6H...
[1] https://docs.google.com/presentation/d/1OqjVqRhtwlKeKfvMdX6HaCIu9wpZsrzqpIVIwQSuiXQ/edit#slide=id.g1453eb7f19_5_97 https://docs.google.com/presentation/d/1OqjVqRhtwlKeKfvMdX6H...
[2] https://docs.google.com/presentation/d/1OqjVqRhtwlKeKfvMdX6HaCIu9wpZsrzqpIVIwQSuiXQ/edit#slide=id.g1453eb7f19_0_391 https://docs.google.com/presentation/d/1OqjVqRhtwlKeKfvMdX6H...
[3] https://youtu.be/r5OWCtuKiAk https://youtu.be/r5OWCtuKiAk
edit: Removed comment about edge, it was more assumption than anything.
- natorion 10y agoGreat summary with a few nits! 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 :-). Full disclosure: I work on the V8 team.
- Klathmon 10y agoI gotta be honest, I've only heard that in comments and "not so reliable" sources, so I should probably remove it while I can. As for the Ignition+TurboFan setup, are you really that far along already? Last I heard a few months ago it still sounded like it was gonna be a while before TurboFan was fast enough in most cases to be able to handle it. If so that's awesome!
- natorion 10y agoIt is progressing quite nicely. We still don't know yet when it is ready to graduate from Canary/Dev though. Lot's of stuff to do!
- gsnedders 10y agoFrom 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?
- sedachv 10y ago> 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.