USING RUST TO BUILD THE NEXT GENERATION WEB BROWSER



Similar documents
What is an Adrenaline Web Browser?

Crosswalk: build world class hybrid mobile apps

AUTOMATED CONFERENCE CD-ROM BUILDER AN OPEN SOURCE APPROACH Stefan Karastanev

Bridging the Gap: from a Web App to a Mobile Device App

Demystifying Page Load Performance with WProf

WHITE PAPER. Domo Advanced Architecture

Performance Analysis of Web-browsing Speed in Smart Mobile Devices

Mobility Introduction Android. Duration 16 Working days Start Date 1 st Oct 2013

Web Development. How the Web Works 3/3/2015. Clients / Server

GUI and Web Programming

Lecture 17: Mobile Computing Platforms: Android. Mythili Vutukuru CS 653 Spring 2014 March 24, Monday

JavaFX Session Agenda

IBM Worklight: Responsive Design for Mul8- Channel Applica8on Development

Responsive Web Design Creative License

<Insert Picture Here> Java, the language for the future

Rethinking Online Code Editors for Supporting Time-based Web Documents

Take full advantage of IBM s IDEs for end- to- end mobile development

The V8 JavaScript Engine

Update logo and logo link on A Master. Update Date and Product on B Master

Web Design Technology

ECWM511 MOBILE APPLICATION DEVELOPMENT Lecture 1: Introduction to Android

Android Operating System:

Modern Web Development with Dart. Alan Knight Google

Introduction to WebGL

Lecture 1 Introduction to Android

Fast track to HTML & CSS 101 (Web Design)

Enable Your Automated Web App Testing by WebDriver. Yugang Fan Intel

CHOOSING THE RIGHT HTML5 FRAMEWORK To Build Your Mobile Web Application

Example. Represent this as XML

Mobile Performance Management Tools Prasanna Gawade, Infosys April 2014

Extending Tizen Native Framework with Node.js

Performance Optimization and Debug Tools for mobile games with PlayCanvas

Issues of Hybrid Mobile Application Development with PhoneGap: a Case Study of Insurance Mobile Application

HTML5 & Digital Signage

Front-End Performance Testing and Optimization

Rich User Interfaces for Web-Based Corporate Applications

Browser Performance Tests We put the latest web browsers head-to-head to try to find out which one is best!

Browser Testing Framework for LHG

Mobile Web Design with HTML5, CSS3, JavaScript and JQuery Mobile Training BSP-2256 Length: 5 days Price: $ 2,895.00

HTML5 AUTOMOTIVE 2013 White Paper Series

Testing on the other side of the pendulum

Progressive Enhancement With GQuery and GWT. Ray Cromwell

Smartphone Application Development using HTML5-based Cross- Platform Framework

Pattern Insight Clone Detection

Monitoring the Real End User Experience

<Insert Picture Here>

HeuTX Riders \ A HOLISTIC APPROACH TO WEB DESIGN

General Introduction

Parallel Web Programming

An Overview of Amazon Silk Amazon s new cloud-powered browser

ANDROID PROGRAMMING - INTRODUCTION. Roberto Beraldi

Mobile App Testing Guide. Basics of Mobile App Testing

Unlocking the Java EE Platform with HTML 5

Introduction to Mobile Performance Testing

Project Proposal. Developing modern E-commerce web application via Responsive Design

PLAYER DEVELOPER GUIDE

Research and Design of Universal and Open Software Development Platform for Digital Home

10CS73:Web Programming

STeP-IN SUMMIT June 2014 at Bangalore, Hyderabad, Pune - INDIA. Mobile Performance Testing

PST_WEBZINE_0X04. How to solve XSS and mix user's HTML/JavaScript code with your content with just one script

Mobile App Infrastructure for Cross-Platform Deployment (N11-38)

PARALLEL JAVASCRIPT. Norm Rubin (NVIDIA) Jin Wang (Georgia School of Technology)

SYST35300 Hybrid Mobile Application Development

Web Design Contract. Summary: What do both parties agree to do? Date: [date] Between us [company name] and you [customer name]

Automated testing for Mobility New age applications require New age Mobility solutions

CSCI E 98: Managed Environments for the Execution of Programs

Resource Utilization of Middleware Components in Embedded Systems

Research on HTML5 in Web Development

AT&T Connect System Requirements for End Users v9.5. March 2013

Akita International University Online Application System. Usage Manual

Cross-Platform Tools

Data Visualization Frameworks: D3.js vs. Flot vs. Highcharts by Igor Zalutsky, JavaScript Developer at Altoros

Responsive Web Design. vs. Mobile Web App: What s Best for Your Enterprise? A WhitePaper by RapidValue Solutions

Republic Polytechnic School of Infocomm C308 Web Framework. Module Curriculum

CLASSROOM WEB DESIGNING COURSE

Android Operating System

COS 318: Operating Systems. Virtual Machine Monitors

A Hybrid Visualization System for Molecular Models

Software Product Information. Faba5 Website

IT3504: Web Development Techniques (Optional)

HEIX 701: Research Project

Web Development with the Eclipse Platform

PERFORMANCE OF BÉZIER CURVES RENDERING IN WEB BROWSERS

Similarity-based Web Browser Optimization

IT3503 Web Development Techniques (Optional)

Multi-Threading Performance on Commodity Multi-Core Processors

Accelerating Business Value by

Chapter 1. Introduction to web development

CS 377: Operating Systems. Outline. A review of what you ve learned, and how it applies to a real operating system. Lecture 25 - Linux Case Study

Informatica Data Director Performance

Icon Standardization For Web Applications

Garfield Public Schools Fine & Practical Arts Curriculum Web Design

Automation using Selenium

Android Architecture. Alexandra Harrison & Jake Saxton

Administrator s Guide

Rich-Internet Anwendungen auf Basis von ColdFusion und Ajax

BogDan Vatra and Andy Gryc. Qt on Android: Is it right for you?

Trivera Technologies LLC

Multiprocessor Scheduling and Scheduling in Linux Kernel 2.6

Transcription:

USING RUST TO BUILD THE NEXT GENERATION WEB BROWSER Lars Bergstrom Mozilla Research Mike Blumenkrantz Samsung R&D America

Why a new web engine? Support new types of applications and new devices All modern browser engines (Safari, Firefox, Chrome) originally designed pre-2000 Coarse parallelism Tightly coupled components Vast majority of security issues are related to the C++ memory model

Servo Written in a memory-safe systems language, Rust Architected for parallelism Coarse (per-tab), as in Chrome Lightweight (intra-page), too Designed for embedding

Rust - safe systems programming C++ syntax and idioms C++-like performance Memory safety Concurrency Parallelism http://www.rust-lang.org

Familiar syntax and performance Rust playpen

Memory safety without overhead Lifetimes and ownership ensure memory safety No garbage collection No reference counting No C++ smart pointer classes

Example of code you can t write Rust playpen

Safe concurrency Rust playpen

How a browser works HTML CSS JS Script Parsing Script & Interactions DOM Layout Flow Tree Render Display Lists More details: http://www.html5rocks.com/en/tutorials/internals/howbrowserswork/

How a browser works Parsing HTML CSS JS Script Script & Interactions This works: <html> <script> document.write ( <h ); </script>1> This is a h1 title </html> DOM Layout Flow Tree Render Display Lists More details: http://www.html5rocks.com/en/tutorials/internals/howbrowserswork/

Timing breakdown Task Percentage Runtime libraries 25% Layout 22% Windowing 17% Script 16% Painting to screen 10% CSS styling 4% Other 6% Data from A Case for Parallelizing Web Pages. Mai, Tang, et. al. HOTPAR 12

Parallelism within pages

Servo s architecture Tab 1 Constellation Pipeline 1 (iframe 1) Renderer Script Layout

Servo s architecture Tab 1 Constellation Pipeline 1 (iframe 1) Pipeline 2 (iframe 2) Renderer Renderer Script Layout Script Layout

Servo s architecture Tab 1 Constellation Pipeline 1 (iframe 1) Pipeline 2 (iframe 2) Pipeline 3 (iframe 3) Renderer Renderer Renderer Script Layout Script Layout Script Layout

Demo: concurrency

Parallel layout Matters hugely on mobile platforms Processors run at lower frequencies, but many cores Would enable more complicated pages on all platforms Implemented by work-stealing algorithm See: Fast and Parallel Webpage Layout. Meyerovich and Bodik. WWW 2010.

Parallel layout body div div div text bold text text

Parallel layout Queue body div div div div div div text bold text text

Parallel layout challenges HTML layout has complex dependencies Inline element positioning Floating elements Vertical text Pagination Considering adding speculation

Parallel layout - wikipedia Each color is a different processor core

Parallel layout - reddit Each color is a different processor core

Parallel layout speedups (CNN)

Parallel layout speedups (Reddit)

Aside: parallelism for power, too Force low-frequency CPU setting Above four cores, same end-to-end performance as single core at high-frequency BUT, 40% of the power usage Could also parallelize more Rendering, CSS selector matching, etc.

Servo vs. Gecko (CNN)

Servo vs. Gecko (reddit)

From engine to browser Servo just renders pages Similar to the Blink and Gecko engines Designed to work in many browser shells Firefox OS, over interprocess communication (IPC) Android, by implementing a Java wrapper On the desktop with

What is embedding? Hosting web engine in native application

Why embed? Reduced development time HTML5 popularity

How not to embed WebKit Blink Both suffer from an unstable API Application developer choices: Ship full browser engine with application Continually update to match breakages

How to embed? CEF: Chromium Embedded Framework Isolates application developers from core API C API with C++ extensions

Servo embedding strategy Stable API/ABI Extensive API testing is a plus C-based Flexible Already designed

How to embed with Servo? Use CEF API+ABI Removes need for YA embedding API Less competition, more coding Allows easy testing between engines Servo: the pragmatic embedding engine

Servo embedding methodology Full symbol/abi coverage Every CEF function call resolves to a Servo function Struct allocation sizes are identical typedef struct _cef_string_utf8_t { char* str; size_t length; void (*dtor)(char* str); } cef_string_utf8_t; pub struct cef_string_utf8 { pub str: *mut u8, pub length: size_t, pub dtor: extern C fn(str: *mut u8), } C Rust

Servo embedding development Start with base set of symbols `nm -u` on CEF applications Track function execution CEF <-> Blink <-> Application <-> CEF Mimic CEF behavior using Servo equivalents Use preload hacks to test LD_PRELOAD on Linux

Servo passes basic browser tests

Improving CSS feature coverage https://docs.google.com/spreadsheets/d/1cxls8w8gwk-2euverrqpuub76piza6w5h5engsl9kfs/edit#gid=555855884

Servo roadmap https://github.com/servo/servo/wiki/roadmap Q2 2015 Increase Servo quality - work on more sites Demonstrate superior end-to-end performance Mobile / embedded 2015 Full Alpha-quality release

Getting involved with Servo www.github.com/servo/servo/ issues Filter for E-Easy irc.mozilla.org, #servo channel Worldwide community Looking for more partners and contributors Hiring! larsberg@mozilla.com zmike@samsung.com