Servo Architecture: Safety & Performance
Jack Moffitt // Mozilla Research // LCA 2017
1994
1994 Pentium
2002 Pentium IV
2008 Nehalem
Let’s rewrite C++ from scratch so that we can rewrite a browser from scratch.
How do we make Servo fast?
How do we make Servo fast?
LCA 2015
CONSTELLATION
SINGLE PROCESS
Monolithic Engine
Monolithic Engine v2
MULTIPROCESS
Two Processes
N Processes
If One Tab Fails...
Only Its Process Fails
Sandboxing
THREADS
Thread per Tab
Multiprocess Thread per Tab
Summary
IS THIS THE BEST WE CAN DO?
Apply Parallelism
Let JavaScript and layout run simultaneously
PIPELINE
Single Pipeline
Pipeline with Cross-Domain Iframes
cross-domain iframe from as.jivox.com
Pipeline with Sync Iframes
CONSTELLATION
Multiple Tabs
Remember, If One Tab Fails...
Only Its Process Fails
Rust Can Fail Better
Most Failures Stop at Thread Boundaries
SANDBOXING & SECURITY
Multiprocess Constellation
More Processes More Better
WEBRENDER
2008 Nehalem
2016 Skylake
Using the GPU
But, but, but...
Don’t browsers already use GPUs?
Sort of...
WebRender Key Ideas
pub enum SpecificDisplayItem {
Rectangle(...),
Text(...),
Image(...),
YuvImage(...),
WebGL(...),
Border(...),
BoxShadow(...),
Gradient(...),
Iframe(...),
PushStackingContext(...),
PopStackingContext,
PushScrollLayer(...),
PopScrollLayer,
}
Rendering Pipeline
Example: Box Shadow
Example: Text
PROJECT QUANTUM
Main Quantum Particles
Stylo on Wikipedia
Stylo on HTML5 Spec
RESEARCH IN PROGRESS
Pathfinder - GPU Font Rasterizer
Magic DOM
External Research Collaborations
GETTING INVOLVED
Unique Developers by Browser
http://mo.github.io/2015/11/04/browser-engines-active-developers-and-commit-rates.html
How to Get Involved