With increasingly powerful web applications, web browsers today need a boost to handle the load

May 25, 2009 11:23 GMT  ·  By

The Chromium blog had a post recently about the scalability of the V8 JavaScript engine, in which it describes why it is important for a JavaScript engine to scale well when faced with modern complex web applications. With web applications becoming more and more powerful, replacing desktop applications in some cases, the JavaScript engines in browsers are becoming increasingly important. This has led to a boost in development focusing on the JavaScript engines on all major browsers.

Chromium is an open-source project based on Google's browser Chrome that aims to bring the browser to Linux distributions as well as provide a more “open” environment for the project, which they feel Google isn't doing. The team describes what they are doing to ensure the V8 engine is capable of handling even the most demanding of web applications.

They begin by explaining why there is a need for scalability in the case of JavaScript engines. “With the increased complexity comes more JavaScript code and more objects. An increased number of objects puts additional stress on the memory management system of the JavaScript engine, which has to scale to deal efficiently with object allocation and reclamation. If engines do not scale to handle large object heaps, performance will suffer when running large web applications.”

Next they show how they are approaching the problem using 'generational garbage collection', which is based on the fact that most objects created either die very young or are long-lived. The garbage collector in V8 doesn't check objects marked as long-lived on every garbage collection but instead it focuses on the newly created objects. The team also added a new benchmark in the V8 benchmark suite. It is called the Splay benchmark and it builds a large splay tree then modifies it by creating and removing nodes from the tree. The test showed that V8 scaled very well with only a 17% drop in performance after increasing the working set seven times.

Photo Gallery (2 Images)

V8 is faster than many JavaScript engines
Splay Scalability Benchmark
Open gallery