Google expert: JavaScript is a critical tool for website performance

Source: Internet
Author: User
Tags website performance akamai technologies

BKJIA quick translation: today, even general internet users know how to make websites run faster when designing websites: Reduce the number of requests sent to servers and reduce the JPEG size, and get services from content delivery network providers such as Akamai Technologies or Limelight Networks.

The problem is that, according to a senior performance optimization engineer, these methods to optimize Web servers have little effect. This engineer is Steve Souders, And now Google is dedicated to optimizing the chief engineer. Previously, he served the same job as Yahoo.

"We used to break up Apache code to see how Yahoo was running," Souders said. After detailed analysis, Souders was surprised to find that when loading a webpage, only 10% to 20% of the time was used by the server.

At the Microsoft technology conference in Los Angeles on Tuesday, Souders said that the latency was mostly the result of code execution in Web browsers. Souders said that on today's multiple AJAX webpages, the problematic code is often JavaScript. He said that this is not because the JavaScript file on the Web page is too large, but because the Web browser handles JavaScript.

"Because we need to execute all JavaScript files in sequence, it is better to abort other downloads when the first Web browser decides whether to execute one of them ." So that other Code cannot be executed or processed.

This approach may be reasonable ten years ago, but today's computer is driven by dual-core and quad-core CPUs, and the situation is different. In addition, the delay will cause a high price.

Souders said Google found that the latency of 500 ms of network traffic would be reduced by 20%, and Amazon also saw that the latency of 100 ms reduced sales by 1%.

Better browsers and better performance

The new and upcoming Web browsers can download these files while executing JavaScript files. Souders said that Internet Explorer 8 released last month has this performance and will launch Mozilla Firefox 3.5 and Google Chrome 2.0. BKJIA Editor note: these four browsers have released important updates in the last two months, and some people have compared their performance. According to international reports, javaScript becomes the main battlefield of browser wars.

Souders said that the improvements will not be very great without detailed overhaul of JavaScript.

To solve this problem, Souders first recommended a free tool called Yslow. Yslow analyzes and grades the maximum speed of Web pages. Yslow 2.0, originally created for IE, is a Firefox additional component combined with Firebug web development tools. It can be downloaded from the Yahoo Developer Network.

You can use Yslow to view the status of JavaScript loading and determine whether a bottleneck has occurred. Then, the user can break down the JavaScript file, only after loading the required JavaScript, leaving the rest to the end, that is, after the text and image appear.

This method increases the display speed of the homepage of a Google website that Souders does not want to name by 60%.

CSS also affects website performance.CSS files describing the appearance of Web pages have become increasingly complex in recent years.

CSS files become a problem, in part because users tend to stay on multiple CSS pages such as Web mail portals all day long. Souders said these websites will be re-presented all day long, resulting in a delay caused by too detailed descriptions of CSS files each time.

In addition to JavaScript and CSS, Yslow has analyzed a total of 22 standard specifications. Yslow is unbiased in terms of classification. Famous websites such as Apple.com, ESPN.com, And Wikipedia are classified as C, and NYTimes.com, NBA.com, and Computerworld.com are classified as worse E.

"Looking at this, I think it is like a teacher who strictly scores ." Souders said.

Search engines with few content on pages like Google.com and Microsoft Live.com belong to A very few Class A on Yslow.

In addition to Yslow, there are other tools available to detect performance bottlenecks. Microsoft provides Visual Roundtrip Organizer, and AOL develops an instant open source code tool called PageTest. All these tools use a set of guidelines to judge the performance of the Web site. However, none of these standards can be compared with the 22 standards of Yslow.

Original article: JavaScript-the Web site performance killer, Google guru says by Eric Lai

  1. JavaScript becomes the main battlefield of Browser Wars
  2. Comparison of the performance of JavaScript-parsed Json strings in various browsers
  3. Toutiao, March 20: The ultimate PK for four browsers (multiple pictures)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.