Servo: The parallel web engine
Bruno de Oliveira Abinader	

brunoabinader@gmail.com
bruno.d@partner.samsung.com	

FISL 15 | 2014 | Porto Alegre, Brasil
/whoami	

abinader @ irc.freenode.org | irc.mozilla.org | irc.w3.org	

Ohloh: ohloh.net/accounts/brunoabinader	

GitHub: github.com/brunoabinader	

Blog: abinader.com.br
Introdução
• Scenario: Mobile web browsers	

• What is Servo? What is Rust?	

• Servo: Objectives	

• Servo: Current status	

• Servo: Challenges and future plans	

• Contributing to Servo and Rust
Scenario: Mobile web browsers
Predictions for 2014 and beyond*:	

• Web pages will grow in size and complexity	

• Focus on mobile web browsers performance	

• Devices will have more cores, not faster cores
Scenario: Mobile web browsers
Load time of a web page in Desktop vs. Mobile**:	

Sources:	

http://www.webperformancetoday.com/2014/01/07/eight-web-performance-predictions-for-2014/	

http://www.eecs.berkeley.edu/~lmeyerov/projects/pbrowser/pubfiles/playout.pdf
Scenario: Mobile web browsers
Slowness causes:	

• Single-core mobile devices	

• Browsers do not adapt to multi-core devices	

• JavaScript code run in a single thread
Scenario: Mobile web browsers
Further issues:	

• Huge code base: multiple architectures, multiple ports	

• Support for deprecated platforms, specifications and
architectures	

• Security vulnerabilities on C++ memory management
What is Servo?
What is Servo?	

document
html
head body
title p
DOM Example Hello World!
What is Servo?	

Servo is an experimental web engine:	

• Developed by Mozilla, in partnership with Samsung	

• Aims to create a highly parallel and safe environment	

• Focus on mobile and embedded	

• Has symbiotic relationship with Rust programming language
What is Servo?	

Under the hood:	

• SpiderMonkey JavaScript engine	

• Azure drawing library (Skia)	

• Hubbub HTML parser	

• Harfbuzz text shaping library
What is Rust?
What is Rust?	

Rust is a programming language:	

• Developed to be safe, concurrent and practical	

• Focus on creation of reliable and efficient systems	

• #2 on GitHub’s “repositories with most amount of closed
issues” in 2013
What is Rust?	

Example:
Servo: Objectives
• Advantage from parallelism in various levels	

• Eliminate common causes for bugs and security flaws	

• Based on WHATWG live specifications
Servo: Current status
We do ACID2!
Servo: Challenges
• Performance: Parallelism trade-offs	

• Rust data structures	

• Rust language immaturity	

• Hostile libraries to parallelism and security controls
Servo: Challenges
Strategies for optimal parallelism:	

Task-based architecture
Copy-on-write DOM
Parallel rendering
Tiled rendering
Layered rendering
Selector matching
Parallel layout
Text shaping
Parallel parsing
Image decoding
Other decodings (eg. Video)
GC JS in parallel with layout
Servo: Future plans
Roadmap for 2014:	

• Demonstrate better performance than other web
engines (eg. Gecko, WebKit, Blink, Trident)	

• Implement all Servo architecture	

ACID2 | Parallel layout | HTML parser in Rust | Bidirectional
writing | Vertical writing | Gestures | XMLHTTPRequest |
Incremental layout | COW DOM | W3C Platform Tests | CSS WG
tests | Android buildbot | Embedding | Pagination | CSSOM |
CSS Properties | DOM bindings | Caching | FlexBox | Web
Animations | Multiprocess | Multimedia | Sandboxing | Addons
| Bookmarks | History | Cookies | …
Contributing to Servo and Rust	

• Contributions are welcome!	

• Servo: github.com/mozilla/servo	

• Rust: github.com/mozilla/rust | rust-lang.org	

• #servo | #rust | #rust-internals @ irc.mozilla.org	

• dev-servo | rust-dev @ lists.mozilla.org	

• Reviews: critic.hoppipolla.co.uk	

• News: blog.octayn.net
Contributing to Servo and Rust	

• Servo: Supported systems:
Contributing to Servo and Rust	

• First good bugs list @ GitHub issues	

• CSS properties	

• DOM Bindings	

• Janitoring	

• Tests	

• Documentation
Questions?
Thank you!
Special thanks:

Servo: The parallel web engine

  • 1.
    Servo: The parallelweb engine Bruno de Oliveira Abinader brunoabinader@gmail.com bruno.d@partner.samsung.com FISL 15 | 2014 | Porto Alegre, Brasil
  • 2.
    /whoami abinader @ irc.freenode.org| irc.mozilla.org | irc.w3.org Ohloh: ohloh.net/accounts/brunoabinader GitHub: github.com/brunoabinader Blog: abinader.com.br
  • 3.
    Introdução • Scenario: Mobile webbrowsers • What is Servo? What is Rust? • Servo: Objectives • Servo: Current status • Servo: Challenges and future plans • Contributing to Servo and Rust
  • 4.
    Scenario: Mobile webbrowsers Predictions for 2014 and beyond*: • Web pages will grow in size and complexity • Focus on mobile web browsers performance • Devices will have more cores, not faster cores
  • 5.
    Scenario: Mobile webbrowsers Load time of a web page in Desktop vs. Mobile**: Sources: http://www.webperformancetoday.com/2014/01/07/eight-web-performance-predictions-for-2014/ http://www.eecs.berkeley.edu/~lmeyerov/projects/pbrowser/pubfiles/playout.pdf
  • 6.
    Scenario: Mobile webbrowsers Slowness causes: • Single-core mobile devices • Browsers do not adapt to multi-core devices • JavaScript code run in a single thread
  • 7.
    Scenario: Mobile webbrowsers Further issues: • Huge code base: multiple architectures, multiple ports • Support for deprecated platforms, specifications and architectures • Security vulnerabilities on C++ memory management
  • 8.
  • 9.
    What is Servo? document html headbody title p DOM Example Hello World!
  • 10.
    What is Servo? Servois an experimental web engine: • Developed by Mozilla, in partnership with Samsung • Aims to create a highly parallel and safe environment • Focus on mobile and embedded • Has symbiotic relationship with Rust programming language
  • 11.
    What is Servo? Underthe hood: • SpiderMonkey JavaScript engine • Azure drawing library (Skia) • Hubbub HTML parser • Harfbuzz text shaping library
  • 12.
  • 13.
    What is Rust? Rustis a programming language: • Developed to be safe, concurrent and practical • Focus on creation of reliable and efficient systems • #2 on GitHub’s “repositories with most amount of closed issues” in 2013
  • 14.
  • 15.
    Servo: Objectives • Advantage fromparallelism in various levels • Eliminate common causes for bugs and security flaws • Based on WHATWG live specifications
  • 16.
  • 17.
    Servo: Challenges • Performance: Parallelismtrade-offs • Rust data structures • Rust language immaturity • Hostile libraries to parallelism and security controls
  • 18.
    Servo: Challenges Strategies foroptimal parallelism: Task-based architecture Copy-on-write DOM Parallel rendering Tiled rendering Layered rendering Selector matching Parallel layout Text shaping Parallel parsing Image decoding Other decodings (eg. Video) GC JS in parallel with layout
  • 19.
    Servo: Future plans Roadmapfor 2014: • Demonstrate better performance than other web engines (eg. Gecko, WebKit, Blink, Trident) • Implement all Servo architecture ACID2 | Parallel layout | HTML parser in Rust | Bidirectional writing | Vertical writing | Gestures | XMLHTTPRequest | Incremental layout | COW DOM | W3C Platform Tests | CSS WG tests | Android buildbot | Embedding | Pagination | CSSOM | CSS Properties | DOM bindings | Caching | FlexBox | Web Animations | Multiprocess | Multimedia | Sandboxing | Addons | Bookmarks | History | Cookies | …
  • 20.
    Contributing to Servoand Rust • Contributions are welcome! • Servo: github.com/mozilla/servo • Rust: github.com/mozilla/rust | rust-lang.org • #servo | #rust | #rust-internals @ irc.mozilla.org • dev-servo | rust-dev @ lists.mozilla.org • Reviews: critic.hoppipolla.co.uk • News: blog.octayn.net
  • 21.
    Contributing to Servoand Rust • Servo: Supported systems:
  • 22.
    Contributing to Servoand Rust • First good bugs list @ GitHub issues • CSS properties • DOM Bindings • Janitoring • Tests • Documentation
  • 23.
  • 24.