Advertisement
Top
MIT and Harvard found a way to speed up web browsing

MIT and Harvard found a way to speed up web browsing

March 10, 2016

Category:

Remember when you could listen to Pearl Jam’s entire Ten album while you were loading a web page? 26 years have passed since the world’s first website went online (info.cern.ch), and now most web pages load in the blink of an eye. According to a collaborative paper by teams from Harvard and MIT Computer Science Artificial Intelligence Lab (CSAIL), they have found a method that can speed loading times by up to 34 percent.

Because our entire lives have moved on the web in the past years, page loading time is essential for businesses as well. Consumers now expect a web page to load in 2 seconds or less. A faster loading page means more conversions. Even 1 extra second for loading can prompt a reduction in a page’s conversions. In e-commerce terms, a slow-loading page could add up to tens of thousands of dollars lost per day, and millions lost in a year.

Search engines rank each page based on loading time as well. A higher rank means better positioning in results, which results in more visits and conversions. To sum up, loading time is very important, and with so many options flying around, consumer patience should not be tested.

Titled “Polaris: Faster Page Loads Using Fine-grained Dependency Tracking”, the collaborative paper introduces new ways to speed up web page loading. Credits for this work go to MIT CSAIL’s Ravi Netravali, Ameesh Goyal, Hari Balakrishnan, and Harvard University’s James Mickens.

“We provide two contributions,” they wrote. “First, using a new measurement platform called Scout that tracks fine-grained data flows across the JavaScript heap and the DOM, we show that prior, coarse-grained dependency analyzers miss crucial edges: across a test corpus of 200 pages, prior approaches miss 30% of edges at the median, and 118% at the 95th percentile. Second, we quantify the benefits of exposing these new edges to web browsers. We introduce Polaris, a dynamic client-side scheduler that is written in JavaScript and runs on unmodified browsers; using a fully automatic compiler, servers can translate normal pages into ones that load themselves with Polaris. Polaris uses fine-grained dependency graphs to dynamically determine which objects to load, and when.”

When loading a web page, a browser fetches and evaluates different objects (HTML files, JavaScript code), which can result in additional evaluated objects on the side, increasing the loading time. Web page loading therefore requires a browser to resolve a dependency graph. The dependency graph captures “load-before” relationships between a page’s HTML, CSS, JavaScript, and image objects.  For example, a browser must parse the HTML <script> tag for a JavaScript file before that file can be fetched. This partial ordering constrains the sequence in which a browser can process individual objects. Unfortunately, many edges in a page’s dependency graph are unobservable by today’s browsers, explains the Polaris paper. To avoid violating these hidden dependencies, browsers make conservative assumptions about which objects to process next, leaving the network and CPU underutilized.

By prioritizing the fetches of objects along the dynamic critical path, Polaris minimizes the number of RTTs needed to load a page. Experiments with real pages and varied network conditions show that Polaris reduces load times by 34% for the median page, and 59% for the 95th percentile page.

“Prior approaches for loading web pages have been constrained by uncertainty,” they wrote. “The objects in a web page can interact in complex and subtle ways; however, those subtle interactions are only partially captured by lexical relationships between HTML tags. Unfortunately, prior load schedulers have used those lexical relationships to extract dependency graphs. The resulting graphs are underspecified and omit important edges. Thus, load schedulers which use those graphs must be overly conservative, to preserve correctness in the midst of hidden dependencies. The ultimate result is that web pages load more slowly than necessary.”

Polaris is based in JavaScript, therefore it can be deployed on every site, without any special browser required. Both the visitor’s browser and the website have to use the framework in order for it to work.

Created by Sir Tim Berners-Lee – a researcher at the European Organization for Nuclear Research (CERN), the world’s first website was practically the founder of online searching and sharing. We’ve come a long way since that remarkable achievement, with increased loading time, better functionality and design. But is the current loading time fast enough? Well, of course not. There’s always room for improvement, and the collaborative work of Harvard and MIT now shows us that there is a solution as well.

According to Ravi Netravali – one of the researchers from MIT CSAIL, Polaris will be open-source in the future. The collaboration was meant to improve loading time, so we can only keep our fingers crossed for the adoption of Polaris extensions in popular browsers.