Accelerating performance on Qt and WebKit for the MIPS architecture

24
Accelerating performance on Qt and WebKit for the MIPS architecture Delivering the Best Web Experience for Embedded Devices

description

Delivering the Best Web Experience for Embedded Devices. Presentation held during Qt Developer Days 2009. http://qt.nokia.com/developer/learning/elearning

Transcript of Accelerating performance on Qt and WebKit for the MIPS architecture

Page 1: Accelerating performance on Qt and WebKit for the MIPS architecture

Accelerating performance on Qt and 

WebKit for the MIPS architectureDelivering the Best Web Experience 

for Embedded Devices

Page 2: Accelerating performance on Qt and WebKit for the MIPS architecture

Agenda

• MIPS Introduction• Emerging Trends• Web Connectivity• JIT Optimizations for WebKit• Benchmarks• Summary

Page 3: Accelerating performance on Qt and WebKit for the MIPS architecture

MIPS Technologies Overview

MIPS®: Number One Processor Architecture for the Digital Home

MIPS develops & licenses processor IP for the embedded semiconductor market

Hundreds of licenses

Billions of units shipped

At the core of today’s most innovative digital consumer products

Page 4: Accelerating performance on Qt and WebKit for the MIPS architecture

MIPS Segments & Markets

Other Segments

PersonalEntertainment

Home Networking

HomeEntertainment

DM

A

STBDTV VoIP WiFi Modem/RG

NA

S

PND/PMP

DSC

/DVC

Consumer

Mobile

Communication

Microcontrollers, Enterprise

Gam

es

Prin

ters

&C

opie

rs

AppliancesTelematics Inte

rnet

Infr

a

DVD

MID/Netbook

DPF

Page 5: Accelerating performance on Qt and WebKit for the MIPS architecture

End Market Share& Customers

Digital TV 60%

Set Top Box-Cable 72%-IPTV 75%

DVD-Blu-ray 75%-DVD 72%

Digital Camera 31%

Mobile TV& GPS PMP 60%

Our customers include

MIPS Processors: Owning “The Digital Home”-The Growth Sector of Semiconductors for 2009-

Page 6: Accelerating performance on Qt and WebKit for the MIPS architecture

4KS

M4K

4KE

24KE

34K

1004K

74K

M14K

M14Kc24K

Broad range of

synthesizable processors,

optimized for low-power convergent consumer multimedia applications

4KE: Cache, MMU

M4K: MCU, Low Cost

4KS: Security

34K: Multi-threading

24KE: DSP extensions

24K: 8-stage pipeline 800 MHz(65nm)

1004K: Multi-threaded (34K), Multiprocessor (1-4 cores)Coherence Management Unit1.3+ GHz (40nm), 1.5DMIPS/MHz/Core

74K: Superscalar 15-stage pipeline1.1 GHz in 65nm (prod’n frequency) Up to 2.7GHz in 40nm

microMIPS, MIPS32Reduced interrupt latencyAHB, advanced debug

MIPS 32-Bit Processor Core Families

microMIPS

M14Kc

Page 7: Accelerating performance on Qt and WebKit for the MIPS architecture

Agenda

• MIPS Introduction• Emerging Trends• Web Connectivity• JIT Optimizations for WebKit• Benchmarks• Summary

Page 8: Accelerating performance on Qt and WebKit for the MIPS architecture

MIPS in Converging Devices

Networked Digital Photo Frame

Digital Media Player

Universal Media Player

IP PhoneNetworked Media TankMulti-Protocol

IP PhoneIPOD Video

Recorder

Portable Media Player

IP Set-top Box

HD Camcorder

Personal Media Player

Home Entertainment Device

Retail Shopping Terminal

Movie Player STB

LCD TV with Widgets

Page 9: Accelerating performance on Qt and WebKit for the MIPS architecture

Qt Is In Homes Today

Devices–Roku Netflix Player–Neuros OSD–Blu-Ray Players

Software –MythTV PVR–LinuxMCE

9 © 2009 Nokia

Page 10: Accelerating performance on Qt and WebKit for the MIPS architecture

Bring Internet Media into the Home

10

Internet Connected “HD” Devices

Web Streaming

HTTPH.264

FlashEtc.

Infotainment Portals

INTERNET

Page 11: Accelerating performance on Qt and WebKit for the MIPS architecture

Qt for Embedded Linux

Linux KernelDRMsCAs

Typical STB Software Architecture

MIPSIPU

MIPSSecurity CPU

AudioDSPs

VideoDecoders

MIPSCPU

PeripheralI/O MIPS 74K

AudioµCode

VideoµCode

DemuxµCode

HDMILibrary

Qt GUI ToolKit

Qt WebKitBrowserToolkit

STBMiddleware

Adobe®Flash Lite® Java VM

3rd Party Middleware

OEM App 3rd PartyApp

Page 12: Accelerating performance on Qt and WebKit for the MIPS architecture

Agenda

• MIPS Introduction• Emerging Trends• Web Connectivity• JIT Optimizations for WebKit• Benchmarks• Summary

Page 13: Accelerating performance on Qt and WebKit for the MIPS architecture

What Drives Web Performance?

• Highly web content specific– Interactive AJAX content vs Simple HTML– Image heavy vs. text

• Page rendering• Image rendering• Javascript• Interactive web content is heavily dependent on

Javascript performance– PC: Chrome vs. IE8 vs. Firefox “performance” judged

mainly on Javascript engine performance

Page 14: Accelerating performance on Qt and WebKit for the MIPS architecture

Faster Javascript Leads to “Faster” Web Experience

• PC browser performance differences directly related to Javascript engine– SquirrelFish Extreme (Nitro)

• Javascript Virtual Machine engine used in Webkit Open Source Project

• Some projects that make use of Webkit:Safari, Qt, Arora, Midori

– V8• Chrome

– Tracemonkey (w/ nanoJIT)• Firefox 3.5.x

– IE8

Page 15: Accelerating performance on Qt and WebKit for the MIPS architecture

JIT and the Javascript Engine

• Developing a JIT speeds up browsing performance on Javascript-based webpagesand applications using it as a scripting language

• JIT techniques also helpful for Tamarin– Flash 10– Yahoo Widgets

• Status:– JIT completed and submitted to Webkit project for

review/acceptance– MIPS incorporating into MIPS-Android HD

development

Page 16: Accelerating performance on Qt and WebKit for the MIPS architecture

Agenda

• MIPS Introduction• Emerging Trends• Web connectivity• JIT optimizations for WebKit• Benchmarks• Summary

Page 17: Accelerating performance on Qt and WebKit for the MIPS architecture

MIPS JIT for WebKit JavaScriptCore

• Development environment: Debian 5.0 (lenny).– Debian runs on top of Qemu simulators, MIPS Malta

boards (FPGA), or Sigma boards.• Qt libraries are installed on Debian.

– # apt-get install libqt4-dev• Webkit is configured and built with Qt (--qt) on

Debian.• To accelerate compilation time, we copy Qt

libraries, Qt headers, Qt generated files, and Makefile to an x86 Linux host.Then, we use MIPS linux-cross toolchains from CodeSourcery to cross-compile.

Page 18: Accelerating performance on Qt and WebKit for the MIPS architecture

Implementing JIT

• JIT frameworks need to assign registers for special purposes. The selection of registers is important.– Some registers are used for returned values.– Some registers must be preserved across function

calls.• The design for trampoline is important.

– We need to set up parameters in the stack to be passed to functions.

– We need to support exceptions.– For MIPS position-independent code, we need to

preserve the value of global-pointer register ($28) in the trampoline code.

Page 19: Accelerating performance on Qt and WebKit for the MIPS architecture

Implementing JIT (cont.)

• MIPS PC-relative branches cover 16-bit ranges.– When branches are too far away, direct jump (J)

covers 26-bit ranges.– LUI/ORI/JR covers 32-bit ranges.

• J and LUI/ORI/JR are not PC-relative instructions.• When the buffer to hold instructions is moved, the target

of J and LUI/ORI/JR must be re-calculated and updated.• The relaxation of branches need four extra words. A

short branch is created to jump over four extra words to speed up.

• After JIT code is generated, we need to flush data cache using synci (a user-level instruction).

Page 20: Accelerating performance on Qt and WebKit for the MIPS architecture

All WebKit JIT optimizations are supported

• ENABLE_JIT

• ENABLE_JIT_OPTIMIZE_CALL

• ENABLE_JIT_OPTIMIZE_NATIVE_CALL

• ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS

• ENABLE_JIT_OPTIMIZE_METHOD_CALLS

• YARR_JIT

Page 21: Accelerating performance on Qt and WebKit for the MIPS architecture

Agenda

• MIPS Introduction• Emerging Trends• Web Connectivity• JIT Optimizations for WebKit• Benchmarks• Summary

Page 22: Accelerating performance on Qt and WebKit for the MIPS architecture

Web Performance Benchmarks

V8/Sunspider benchmark suiteAll results normalized to 1 GHz

74Kf_32K/32K_0KB 74Kf_32K/32K_256K (est) A8_16K/16K_256K Atom_32K/24K_512K

Interpreted JIT

H/W Platforms:74Kf = Sigma Designs SMP8642 @ 660 MHzA8 = TI OMAP 3530 @ 500 MHzAtom = Intel Atom 330 @ 1.6 GHz

>2x fasterthan ARM

Same performance asAtom @ a fraction

of the power and cost

Relative Javascript Benchmark Performance

Page 23: Accelerating performance on Qt and WebKit for the MIPS architecture

Agenda

• MIPS Introduction• Emerging Trends• Web Connectivity• JIT Optimizations for WebKit• Benchmarks• Summary

Page 24: Accelerating performance on Qt and WebKit for the MIPS architecture

Best Web and Multimedia Experience Driving Performance

2x performance of ARM!Fraction of the cost and power consumption of Intel!