Enabling the Next 100,000,000 Android Devices

terrificrecordInternet et le développement Web

24 juin 2012 (il y a 2 années et 4 mois)

494 vue(s)

1
Enabling the Next
100,000,000 Android Devices
The Android Software Ecosystem
ARM Android Ecosystem Seminar
Seth Bernsen
May 18
th
, 2011
Taiwan
2
Application
Developers
OEM Partners
Software
Partners
Semiconductor
Partners
Open Source
Community
Engagement Model for Differentiation
Common Foundation
Differentiated Products

Enable apps developers

Connecting OEM/ODM to
software solutions
providers

Enable software and
services vendors

Ensure robust support of
key applications and
capabilities

Organize and rallying the
Open Source community

Open Source engineering
Enabling the Software Ecosystem
3

Over 400,000+ new
application client devices
per day
400,000+ Android Devices Shipping
Per Day
Devices from phones and tablets to
netbook’s
and TV’s running Android on ARM Cortex
-
A Processors
Android represents software trends

Open Source

Application ecosystems

Stack built for services
Range of Premium Content & Services Promotes Platform
4
Anatomy of Google Android

Heavily leverages open source software on ARM

Built around browser and application framework
Linux Kernel
Android
Middleware
SKIA 2D
Graphics
Mobile
Browser
Webkit
V8 JavaScript
Engine
Mobile
AIR
Flash
LLVM
VP8
Dalvik
LLVM
Linux Kernel
Linux
Middleware
SKIA 2D
Graphics
Chrome
Browser
Webkit
V8 JavaScript
Engine
Chrome OS
X Windows
Flash
LLVM
VP8
Linux Kernel
Android
Middleware
SKIA 2D
Graphics
Chrome
Browser
Webkit
V8 JavaScript
Engine
Tablet
Flash
LLVM
LLVM
Dalvik
VP8
Linux Kernel
Android
Middleware
SKIA 2D
Graphics
Chrome
Browser
Webkit
V8 JavaScript
Engine
Google TV
Flash
LLVM
LLVM
Dalvik
VP8
Google

Application
framework

Web browser

JavaScript
engine

Flash

Graphics

System libraries

Linux kernel
5
Dalvik
Java Optimizations for ARM

Dalvik
Java VM for ARMv7

Interpreter support

Instructions/co
-
procs
for
interpreter

UXFB, TBB… VFP, NEON

Tracing JIT support

Focus on hot code paths

Increases performance by 2
-
5x

Minimal memory bloat

Thumb or Thumb
-
2 code
generation

Support for VFP or Soft FP
Dalvik
JIT Benchmark Results
Speedup relative to
Dalvik
Interpreter
JIT Total Memory Usage (in
kBytes
)
6
Native Development Kit (NDK) for ARM

NDK is a comprehensive tool kit to enable application
developers to write directly for the ARM processor

Enhancements in latest NDK r5(b)
Android applications can be
written in Java, native ARM
code, or a combination of
the two
ARM
Improvements

Improved
performance
and
code density
with GCC 4.4.3

Optimizations for Cortex
-
A9

Support for VFPv3
General
highlights

New
NativeActivity
feature
eliminates need to write Java

Addition of default C++ STL

New API’s

Input subsystem, sensor data

Windows, surface subsystem

OpenSL
ES Audio API

Access to APK graphics assets

EGL library to create and manage
OpenGL ES textures and services
7
NativeActivity
for Pure Native Apps

New class called
NativeActivity
enables creation of strictly C
and ASM level applications

Moves “main()” from Java to C

Apps still run in a
Dalvik
sandbox, but
no Java code required

Two methods

Modify the
NativeActivity
class

Full flexibility of main app
thread control

Use native app glue helper
library built on top of
NativeActivity
class

Provides ready made
infrastructure for threading
and blocking behavior
Example main function
written for native code
using NDKr5
8
0
1
1
2
2
3
3
4
4
5
Improvement x times
Benefit of Native Code
-
Scimark 2
Nexus One
Droid
0.0
20.0
40.0
60.0
80.0
100.0
120.0
Tegra A9
Nexus One
Motorola
Droid
MFLOPS
Linpack (scaled to 1GHz)
Dalvik VM
Nativec
2.9 x
2.4 X faster
ARM Native Code vs.
Dalvik

Applications that use ARM
code can result in up to 4x
faster performance than
Dalvik

Access to processor features,
such as ARMv7 NEON
Advanced SIMD instructions

Fast reuse of existing and
cross platform software IP,
including C/C++/
Asm
code
9
GAME
(sample)
ARM
Native Lib
Neon
Optimized
ARM Native Code Examples

Significant impact on a
range of applications

Games

Media Players

Browsers

VoIP clients

All 3D OpenGL ES
content leverages ARM
code
Some of the many applications that
benefit from ARM native code
10
Android Browsing Optimized for ARM

From 2.3/Gingerbread Google
integrates the Chrome browser

3
rd
party browsers like Firefox,
UCWeb
, Opera and many others

ARM working continuously to enable
the three main components of HTML5
JavaScript
CSS
HTML
High performance JavaScript
drives HTML and CSS
Cascading Style Sheets V3.0
change visualization on the fly
HTML5 new markup for
video, audio, graphics, location,
local storage and more
11
ARM JavaScript JIT Support

JavaScript acceleration, all projects accelerate JavaScript by
compiling to native ARM code

ARM optimizations yielded up to
5x+ improvement

ARM contributing optimizations to All projects

Continuing to invest and improve
Java
Optimal JIT
Code
Generation
ActionScript
Virtual Machine
Adobe Flash
Adobe AIR
JavaScript
Virtual Machine
Web Browser
Runtime
Firefox Browser
Fennec Mobile
Browser
Internet
Application
Runtime
Web
Applications
Runtime
Yahoo Widgets
ARM
Investment
JavaScript Project
Foundation
/Package
TraceMonkey
Mozilla
Squirrelfish Extreme
WebKit
V8
Google
Tamarin
nanoJIT
Adobe
Example:
downstream
impact of
nanoJIT
optimization
12

First released as part of Android 2.2 for ARM

VERY fast pure JIT generating native ARM code

Cortex
-
A9 @1GHz completes V8 test suite in <2
secs

Continuous improvement for ARM by both ARM and Google

V8 in Android 3.0 is
>
2x faster than in 2.3!
Google V8 JavaScript Improvements
0
200
400
600
800
1000
1200
1400
1600
1800
2000
Score
Richards
DeltaBlue
Crypto
RayTrace
EarlyBoyer
RegExp
Splay
Cortex
-
A9
-
2.3
Cortex
-
A9
-
3.0
Google V8 Benchmark Suite
-
Run on the same Cortex
-
A9 based
SoC
Google V8 Performance
Improvements for ARM
in Android 3.0
(Higher is Better)
13
Investments in HTML5 Markup

HTML5 introduces new DOM constructs

Audio, video, 2D and 3D graphics, etc…

Optimizing new HTML DOM constructs
for ARMv7 NEON
Construct
Enables
NEON Optimized
Packages
<canvas>
2D bitmap graphics
Cairo,
Skia
<
svg
>
2D vector graphics
Cairo,
Skia
<audio>
Ogg
/
Theora
ffmpeg
<video>
H.264,
TheorARM
,
VP8
WebM
, X.264,
ffmpeg
14
WebM
Open Media Project

Launched May of 2010 to address lack of open video
standard for the web,
WebM
includes:

VP8 video codec licensed under a BSD
-
style, royalty
-
free license

The
Vorbis
open source audio codec

A container format based on a subset of the
Matroska
media
container

Extensively ARM optimized

Over
10,000
lines of ARMv7
NEON code at launch

VP8 on Cortex
-
A9 achieves
better clock for clock
performance than both
Atom and MIPS
Source: ARM benchmarking of
opensource
libvpx
codec running on 400MHz Cortex
-
A9
testchip
with 200MHz DDR
15
WebM
Proven on ARM SMP

Recent
WebM
VP8 source updates
improve threading capability

~45% gain
on dual thread version
running on production ARM Cortex
-
A9
silicon

Decoder results on quad core
Cortex
-
A9 @500MHz

1 thread: 14,8 fps

2 threads: 21,5 fps

3 threads: 24 fps

4 threads: 26 fps
0
10
20
30
1
2
3
4
fps for
720p
1Kbps
0
5
10
15
20
25
One
thread
Two
threads
fps for
1Mbps
720p video
Shields 720p 1024kbps
stream with 2 partitions
Source: ARM benchmarking of
opensource
libvpx
codec running on 500MHz Cortex
-
A9
testchip
with 200MHz DDR
16
Roadmap for CSS and SMP

CSS acceleration with NEON and Mali

Gradients, shadows, opacity, reflection

Hue/saturation/luminance

Transitions and transforms

Animation

Further SMP optimization work on browsers

Collaborating with Mozilla and Szeged

Mozilla Electrolysis

Moving key elements into separate processes
and threads

Video, HTML5 parsing, I/O, JavaScript garbage
collection, graphics compositing
HTML5 JavaScript
Web Workers
(Threads)
enhanced by ARM SMP
TODAY
17
Bringing Flash to Android
Flash
10
Software Rendering
Open GLES 2.0 Open Max IL
Tamarin Central JIT
Codec Optimization
>100 Man years effort
porting and optimizing
Focus on:

Performance Maximization

Power Optimization

Memory Conservation
“It’s great to see that our extensive
technical collaboration on this with
our partners is now becoming a reality.”
-
Paul
Betlem
, Sr. Director
Flash Player Engineering
http://bit.ly/AdobeARMOptimization
18
Adobe Flash & AIR Support for ARM

Adobe Flash 10.3 for Android 2.2 and above

Available from Android Marketplace today!

Adobe AIR for Android 2.2 and above

Browser
-
less Rich Internet Applications

Package as tradition .
apk
Android Apps

Available from the Android Marketplace today!

Broad Adobe Flash10.3 ARM device support

Flash10.3 for ARM through the Open Screen Project

ARM continuing work with Adobe

ARMv7 NEON for graphics and Pixel Bender
operations

Optimizations for SMP architecture
Adobe Flash 10 on a
Nexus One
Adobe AIR in the Marketplace
19
Skia Graphics Engine Optimizations

2D Graphics package still used extensively within Android

Used by Chrome browser and UI framework

Skia
optimized using ARMv7
NEON
intrinsics
and assembly
code

30%
performance uplift on UI use
cases

10%
-
30%
performance uplift on
browser use cases

S
ome
Skia
routines see as much as
500% lift
from NEON
Skia
2D
Graphics
Android
Chrome
Chrome
OS
20
Renderscript
Introduced in 3.0

Enables GPU agnostic
shader
and compute code for high
performance 3D graphics with native like performance

Augments traditional framework API’s and native OpenGL ES

Heavily leverages LLVM

Used by
Xcode
,
OpenCL
,
ActionScript
and
pNaCl

ARM contributes optimizations to
LLVM project

Renderscript
not for all

Increased application complexity

Limited debug visibility

Reduced platform portability

exclusive to Android
To ARM Native
21
Android Platform Highly Optimized for ARM
Dalvik
JIT Support
Renderscript
V8
Javascript
Ogg
Theora
VP8
WebKit
Browser
ARM Native Applications
NDK Tools
Google and ARM are investing significant effort to optimize both Android and
Chrome platforms for the ARM architecture
1,200 files of ARM Assembler
LLVM for
Renderscript
22
Anatomy of an Android Application
AirPlaySDK
System
Libraries
Native
Activity App
Custom
Native
Library
Dalvik
EE
Android System Libraries
Dalvik
Native Libraries
Flash+AIR
EE
Gaya3D
EE
Mono
EE
C/C++/
Asm
Java
ActionScript
, C#,
GayaScript
Dalvik
Native Libraries
Languages
Execution Environments
Native code
Intermediary Byte Code
Android Application

Run as a
Dalvik
process
Android Platform
ARM
23
DS
-
5 for Android App Development

Roadmap from ARM for Android
app development

Integrates with Eclipse framework
alongside Android SDK

Professional native debugging

DS
-
5 to include NDKr5(b) compatible
gdbserver
for native device debug

Streamline

performance analyzer*

Timelines with performance counters

Call path and time
-
based profiling
Compiler
Eclipse
Debugger
Device Configuration Database
Hardware Debug
Streamline
IDE
Simulation
DS
-
5
* Integrated kernel module required
24

ARM ecosystem for Android is incredibly rich

Flash, HTML5, 2D/3D graphics, applications, tools, etc...

The ecosystem grows with the popularity
of Android

Enabling this ecosystem takes
sustained investment

ARM has a history of ecosystem
enablement and continues to invest
in Android

More to come from our software engagements in
2011!
Summary
25
Thank You!