At WWDC this year, Apple was trying to elevate itself by name-calling its competitors. It’s not unusual for someone else to do that kind of marketing, but this is the great and holy Apple. One of the conference released such a picture, you must have seen:

My first impression when I saw this picture was, “Oh, my God! But, you know, I don’t believe it.

While I believe apple is unlikely to cheat, there is no mention of how this result came about, which makes me wonder how 80% came about. Just saying results and not saying where the data came from is like being a bully.

In the spirit of seeking truth and pragmatism, searched the next information, and finally figured out where this 80% came from.

But before we do that, we need to give you a little bit of science.

At the heart of what makes a browser work is something called the “kernel”, which is like the engine of a car. Browsers can’t work without it, and there are many kinds of cores on the market, such as: KHTML, Presto, Trident, WebKit, well-known browsers like Firefox, IE, Opera, Chrome, Safari all use a different kernel, and Chrome and Safari all use the same kernel, Called “WebKit”, WebKit is actually apple based on the open source kernel KHTML to transform, is also open source.

The kernel is actually divided into two parts: rendering engine and JS engine. Rendering engine is mainly responsible for obtaining HTML, XML, images, CSS and other content of the web page for rendering display, JS engine is responsible for parsing javascript language, to achieve the dynamic effect of the web page.

Chrome is also based on the WebKit kernel, but Google initially felt that the WebKit js engine had some performance problems, so Google created a JS engine for Chrome called “V8”, so in the kernel aspect, The main difference between Chrome and Safari is that the JS engine is different, but even if the JS engine is different, there is no reason why Google’s JS engine should be so much slower than WebKit.

Finally figured out the reason on WebKit’s official website. WebKit’s official website published an article on June 5th, and the address is here:

Webkit.org/blog/7536/j…

WebKit is deeply optimized for ES6, the latest core language standard for javascript. Most stable versions of browsers are based on ES5, and Safari development uses areS-6, a new optimized technology. I also tested the online Version of Chrome against their development version, and provided a screenshot of the test:

See, Chrome runs exactly 1.8 times as long as Safari, and now we’ve figured out where Apple’s 80% faster came from.

Have you figured it out so far?

Let me wrap this up for you. Apple released this article the day before WWDC, and the new WebKit JS engine is deeply optimized for ES6, and it’s in Safari development, I then compared it to Chrome’s online version that wasn’t optimized for ES6 and concluded that Safari was 80% faster than Chrome in JS execution, and WWDC cheered.

Really, I can’t help laughing when I know the truth.

Isn’t Chrome optimized for ES6? Of course there is, but at that time it was still Chrome development version, not officially released, but after WWDC, Google did not accept, soon updated a version of Chrome, haha…

A few days ago, Andreasgal.com published a list of browser market share changes over the past six years, and all other browsers failed, with Chrome leading the way:

One might wonder if Chrome’s market share lead is due to Android, but the chart below, which is based solely on PC desktop market share, should be convincing enough:

Data sources are here:

Andreasgal.com/2017/05/25/…

I’m a big Chrome fan myself. I’ve tried all the other browsers, but I still find Chrome to be really good.

  1. The built-in Chrome Dev Tools is a must-have tool for Web development.

  2. Chrome plugins are so rich, basically only you can’t think of, there are no plugins you can’t search, all kinds of useful plugins can make your work, life more colorful;

  3. Chrome has many useful little details, such as the address bar of zhihu.com and press TAB to open zhihu search directly; For example, the shortcut key Cmd + Shift + T (Windows is Ctrl + Shift + T) can return indefinitely to the last page visited;

  4. Chrome is fast, really fast. Let’s say Safari’s JS engine is 80% faster than Chrome’s, but you’d still expect Chrome to be faster. The reason is that you can’t really perceive a performance difference in the kernel, and the biggest speed bottleneck is probably the network traffic. For example, Chrome has a powerful predictive system. When you type in a url, Chrome can predict the url you are going to type, and DNS resolution and preloading can be done in advance, so a lot of times when you type in a url, it will feel like a second. And Safari is 80% faster than Chrome’s JS engine just because it’s happy.

But this a series of optimization measures in view of the network also has a price, can lead to memory usage and CPU consumption is too big, so many times we can feel the Chrome very eat resources it is for this reason, however, I think it is a small problem, change the computer configuration is a little high, can make your own online experience is well worth the more quickly, Especially for developers, how can you be more efficient at work and study if you don’t want to put in the effort to eat?

I don’t know how many of you are already using Chrome, but as a Chrome fan who has been using Chrome for 6 or 7 years, I would like to call on those of you who haven’t, life is too short, please use Chrome!

This article was originally published on the wechat official account AndroidDeveloper.