Mozilla eyes multi-threaded webpage rendering

One page. Many cores

Velocity Mozilla is exploring ways of building a multi-threaded browser DOM for Firefox, so that a single web page can be rendered using multiple processor cores.

"We think it's possible," Mozilla open source evangelist Chris Blizzard said on Thursday at the O'Reilly Velocity conference in Santa Clara, California. "This is an active area of research, and we invite anyone to join us."

Speaking with The Register, Blizzard said that the project is very much in the early stages, but it involves Rust, a new low-level programming language built at Mozilla. Mozilla man Graydon Hoare began Rust as a side project in 2006, but he's now working on it full-time, according to Blizzard. The language is built from the ground up for concurrency and safety. "It's a C++-like languages designed to let you build in parallelism and security," Blizzard said.

Today, Firefox and other browser offer various forms of parallelism. Separate tabs can be run on multiple cores, though they do share some processes. Plug-ins are now run as separate processes. And things like http transactions and video and audio decoding are multi-threaded.

WebGL provides parallelism via GPU hardware acceleration. And with a browser like mobile Firefox, Blizzard said, Mozilla uses separate processes for the browser chrome and the content.

But with Firefox, the DOM (Document Object Model) interface used to render things like HTML and JavaScript is still single-threaded. "The DOM and the way we do layout and the expectations and promises for the way the internal APIs behave are all single-threaded," Blizzard said. "It's very difficult to make the DOM multi-core."

With more and more applications moving to the browser, it only makes sense to break up the DOM's tasks onto multiple cores. This applies to both desktop and mobile devices, which are beginning to see multi-core chips.

In essence, Mozilla is working to rebuild the DOM with Rust. "The idea is to take chunks of the DOM, take chunks of the rendering, and break them into their own tasks and actually be able to take advantage of multi-core machines in a single web page," Blizzard said.

But Blizzard stresses that Mozilla has not deployed any code and has no real schedule for the project. "It's basically research at this point," he said. ®

Sponsored: Driving business with continuous operational intelligence