Servo: Parallelizing the Browser

Josh Matthews, Mozilla Platform Engineer

Servo: Parallelizing the Browser

What is Servo?

  • Browser engine written in Rust
  • Designed for parallelism and safety
  • Designed for embedding
  • Probably a mobile product

Why build a new engine?

  • All modern engines designed pre-2000
  • Difficult to experiment or fundamentally change
  • Security and performance are hard

Browser Architecture

Browser Architecture

Tab 1
Tab 2

Servo Architecture

Servo Architecture

Servo Architecture

Servo Architecture

Research problems:

Parallel layout

Research problems:

Parallel layout

Research problems:

Parallel layout

  • Important for mobile platforms
  • Prevent arbitrary tree access via type system
  • Parallel layout only interacts with children
  • Work stealing task pool, shared queue

Research problems:

Concurrent script/layout

  • Web developers learning to avoid sync layout, eg:
    node.style.left = elem.getBoundingClientRect().right + 5;
  • Run layout and script simultaneously
  • Layout sees consistent DOM, script mutates "shadow" DOM (copy-on-write)

Research problems:

Security

  • C++ memory model responsible for many exploits
  • Rust neutralizes them (use after free, iterator invalidation)
  • Task isolation
  • Process isolation
  • NaCL?

How can I help?

  • Write Rust code (learn Rust, hack Servo (good first bugs))
  • Write JS/CSS code (test suite is small; integrating w3c tests)
  • Build and test Servo, file bugs (nightly builds soon)
  • Watch mozilla.dev.servo mailing list for news

Really helpful contributions

Servo: Parallelizing the browser

Josh Matthews, Platform Engineer

Slides: http://joshmatthews.net/fosdemservo/