SlideShare a Scribd company logo
1 of 71
Download to read offline
Improve Android System
       Component Performance



Jim Huang ( 黃敬群 ) <jserv@0xlab.org>
Developer & Co-Founder, 0xlab
http://0xlab.org/

                      Feb 14, 2012 / Android Builders Summit
Rights to copy
                                                                   © Copyright 2012 0xlab
                                                                          http://0xlab.org/
                                                                          contact@0xlab.org
Attribution – ShareAlike 3.0
You are free                                            Corrections, suggestions, and contributions are
                                                                                             welcome!
   to copy, distribute, display, and perform the work
   to make derivative works                                               Latest update: Feb 14, 2012
   to make commercial use of the work
Under the following conditions
      Attribution. You must give the original author credit.
      Share Alike. If you alter, transform, or build upon this work, you may distribute the
      resulting work only under a license identical to this one.
   For any reuse or distribution, you must make clear to others the license terms of this
   work.
   Any of these conditions can be waived if you get permission from the copyright holder.
Your fair use and other rights are in no way affected by the above.
License text: http://creativecommons.org/licenses/by-sa/3.0/legalcode
0x1ab = 162 + 16x10 + 11 = 427
  (founded on April 27, 2009)

 0xlab is another Hexspeak.
  (pronounce: zero-aks-lab)
About Me   (1) Come from Taiwan
           (2) Contributor of Android
           Open Source Project (AOSP)
           (3) Developer, Linaro
           (4) Focus: system performance
           and virtualization at 0xlab
Mission of 0xlab development:
              Improve UX in SoC



UX = User Experience
SoC = Integrated Computing Anywhere
Strategy and Policy

• open source efforts to improve AOSP
• We focus on small-but-important area of Android.
   – toolchain, libc, dynamic linker, skia, GLES,
     system libraries, HAL
• Develop system utilities for Android
  – benchmark, black-box testing tool, validation
    infrastructure
• Value-added features
   – Faster boot/startup time, Bluetooth profile, visual
     enhancements
• Submit and share changes to community
  – AOSP, CyanogenMod, Android-x86
  – Linaro
Working Model
Rowboat   CyanogenMod   Android-x86
Hidden Bugs in AOSP

• AOSP is dedicated to mobile
Lucky!
  product devices shipped by OHA
  members
We– Fixed hardware "bug" in Android accidently
   encountered the and
     specifications
   – Not well verified for other
     configurations
• Performance is important, but we
  frequently hit the hidden bugs
  when apply aggressive
  optimizations.
   – Quality is the first priority!
Quality in custom Android Distribution

     • 0xlab delivers the advantages of open source
       software and development.
        – Quality relies on two factors: continuous
          development + strong user feedback
     • Several utilities are developed to ensure the
       quality and released as open source software.
        – 0xbench (Android benchmarking tool)
        – ASTER (Android System Testing Environment and Runtime)
        – LAVA (Linaro Automated Validation Architecture)
     • In the meanwhile, performance is improved by
       several patches against essential components.


Tip: Automate system before optimizing
LAVA: Automated Validation Infrastructure for Android

Android benchmark running on LAVA.      Android support on LAVA
Automated Validation flow includes       https://wiki.linaro.org/Platform/Validation/LAVA
from deploy, then reboot, testing,
benchmark running, and result submit.        Android related commands in LAVA:
                                              * deploy_linaro_android_image
                                              * boot_linaro_android_image
                                              * test_android_basic
                                              * test_android_monkey
                                              * test_android_0xbench
                                              * submit_results_on_host




  Check "LAVA Project Update"
        by Paul Larson,
2012 Embedded Linux Conference
0xbench:               comprehensive open source benchmark
                                                  suite for Android
• A set of system utilities for
  Android to perform
  comprehensive system
  benchmarking
  • Dalvik VM performance
  • OpenGL|ES performance
  • Android Graphics framework
    performance
  • I/O performance
  • JavaScript engine performance
  • Connectivity performance
  • Micro-benchmark: stanard C library,
    system call, latency, Java
    invocation, ...


Project page: http://code.google.com/p/0xbench/
: 0xBench
Collect and Analyze results on
                   server-side
Android Functional Testing

• stress test
   – Utilizing 'monkey', which is part of framework
• Automated test
  – Both blackbox-test and whitebox-test are required
Stress Test

• According to CDD (Compatibility Definition Document),
  Device implementations MUST include the Monkey
  framework, and make it available for applications to
  use.
• monkey is a command that can directly talks to
  Android framework and emulate random user input.
  adb shell monkey ­p your.package.name ­v 500


• Decide the percentage of touch events, keybord
  events, etc., then run automatically.
ASTER: Automated Test

        • Blackbox-test vs. Whitebox-test
        • An easy to use automated testing tool with IDE
           – Built upon MoneyRunner
        •   Batch execution of visual test scripts
        •   Multiple chains of recall commands
        •   Designed for non-programmer or Q&A engineers
        •   Use OpenCV to recognize icons or UI hints




Project page: http://code.google.com/p/aster/
Prototype in 2009
ASTER IDE in 2011
It is time to improve the
performance of Android system
            components
No Silver Bullet
to Improve the whole
Possibly Premature optimizations in Android

• “Premature optimization is the root of all evil”
   – Donald Knuth
• bionic libc
   – glibc incompatibility, No SysV IPC, partial Pthread,
     incomplete prelink
   – inactive/incorrect kernel header inclusion
   – May not re-use existing system utilities
• Assumed UI behavior
  – Input event dispatching and handler
  – Strict / non-maintainable state machine (policy)
  – Depending on a certain set of peripherals
• Unclear HAL design and interface
  – Wifi, Bluetooth, GPS, ...
Think Difficult

• To make performance improvement visible
   – Modifications from Application level, Android
     framework, system libraries, and kernel
• Slowdown in newer Android version
   – Example: Graphics in Eclair (2.0/2.1) is much
     slower than 1.5 or 1.6
• To optimize or not to optimize, that is the question.
   – Merge Local optimizations != Optimized
     globally
   – Many Android applications don't take various
     devices into consideration. Thus, performance
     issues occur all the way.
Which parts will be Improved?

       • 2D/3D Graphics
       • Android Runtime
       • Boot time




Three frequently mentioned items in Android engineering are selected
as the entry points: 2D/3D graphics, runtime, and boot time.
Android Graphics
Functional View (1.5)
                                Applications
                                Applications
   Gallery         Phone         Web Browser    Google Maps   ・・・・・

                            Android Framework
                            Android Framework
  Activity        Window           Content                       Notification
                                                View System
  Manager         Manager          Manager                        Manager

  Package        Telephony        Resource        Location
  Manager         Manager         Manager         Manager


                            System Library
                            System Library          Android Runtime
                                                    Android Runtime
SurfaceFlinger
SurfaceFlinger   OpenCORE
                 OpenCORE          SQLite                Class Library

                                                    Dalvik Virtual Machine
                                                    Dalvik Virtual Machine
OpenGL|ES
OpenGL|ES        AudioFlinger
                 AudioFlinger      WebKit

    SGL
    SGL          OpenSSL          bionic libc
                                  bionic libc     Freetype


                                 Linux Kernel
                                 Linux Kernel
Functional View (2.3)
                                           Applications
                                           Applications
              Gallery         Phone         Web Browser    Google Maps   ・・・・・

                                       Android Framework
                                       Android Framework
             Activity        Window           Content                       Notification
                                                           View System
             Manager         Manager          Manager                        Manager

             Package         Telephony       Resource        Location
             Manager          Manager        Manager         Manager         RenderScript

OpenGL|ES 2.x accelerated.             System Library
                                       System Library          Android Runtime
                                                               Android Runtime
     Drop 2D accel
           SurfaceFlinger
           SurfaceFlinger   StageFright       SQLite                Class Library
                                               V8 bridge       Dalvik Virtual Machine
                                                               Dalvik Virtual Machine
GLES 2.0   OpenGL|ES
           OpenGL|ES        AudioFlinger
                            AudioFlinger      WebKit
                                                                            SMP improvements
               Skia
               Skia          OpenSSL         bionic libc
                                             bionic libc     Freetype
                                                                                           JIT compiler
Skia supports GPU backend                      SMP fixes
       In Android 3.x                       Linux Kernel
                                            Linux Kernel
   Properties
                                   Android SurfaceFlinger
        Can combine 2D/3D surfaces and surfaces from multiple applications
        Surfaces passed as buffers via Binder IPC calls
        Can use OpenGL ES and 2D hardware accelerator for its compositions
             Double-buffering using page-flip
from EGL to SurfaceFlinger




hgl = hardware
hgl = hardware      agl = android software
                    agl = android software
 OpenGL|ES
 OpenGL|ES          OpenGL|ES renderer
                     OpenGL|ES renderer
Android Graphics without OpenGL|ES
                                              Hardware
                                              Android Framework (Java)

EventHub           libandroid_runtime
                                    Surfaceflinger                          Copybit
                                           (service)                   (HW accelerated)
 Renamed to libgui
 Renamed to libgui
  in Android 4.0
   in Android 4.0
                                                                 libagl is an optimized GLES 1.x
                                                                  libagl is an optimized GLES 1.x
           libui
                                              libGLES        Impl. Android 4.0 comes with libAgl2,
                                                              Impl. Android 4.0 comes with libAgl2,
                                               (libagl)        which provides software GL ES 2.0
                                                               which provides software GL ES 2.0
                                                               Implementation using Pixelflinger2
                                                                Implementation using Pixelflinger2


                         libpixelflinger
                                                       libpixelflinger is software renderer
                                                        libpixelflinger is software renderer
                                                 Android 4.0 comes with a new implementation,
                                                 Android 4.0 comes with a new implementation,
When GLES doesn't work,
When GLES doesn't work,                           PixelFlinger2, which Is based on LLVM and
                                                  PixelFlinger2, which Is based on LLVM and
software is used                                      Mesa (glsl2-llvm): external/mesa3d
                                                      Mesa (glsl2-llvm): external/mesa3d
software is used
2D Accelerator for Android Graphics
     • libcopybit provides hareware bitblit operations which
       includes moving, scaling, rotation, mirroring, and more
       effects, like blending, dithering, bluring, etc.
     • Removed since Android 2.3
        – But adding it back might improve UX in large screen.
     • Android has two copybit interfaces:
       – Blit: moving / blending
        – Stretch: scaling besides moving
     • libcopybit is called by libagl which can do swapBuffers to
       do the framebuffer page flipping that can also be
       accelerated by libcopybit.



Copybit could improve the performance of page flipping
Copybit could improve the performance of page flipping
Copybit operations
Copybit: 2D blitter
Copybit: 2D blitter
Optimizing Graphics without 3D/HW

 • Implement copybit HAL carefully
    – Minimize clip region
    – Eliminate data copy
 • Check ioctl for page flipping in framebuffer driver
   – Efficiency and consistency
 • Without 3D/HW, Android Graphics is CPU bound
    – Reduce the amount of surfaces to manipulate
    – Optimizing skia (2D vector library) is important
    – Optimize color space conversion
    – Optimize blitter and primitive operations like
      matrix using ARM VFP and NEON
Apply extra performance tweaks against optimized build
2D on Nexus S
                (NEON)
2D Improvement (1)
   external/skia/
   ccommit ae265ac7f132f5d475040edf134e312b3987eade
       Add NEON optimized blitter: RGB565 to ABGR8888 without filter
   and blending


   commit 4b9b68bb9b8f82d6f70d98449851bc4bb19958bd
       optimize blend32_16_row and unroll SkRGB16_Blitter::blitRect


       Reference benchmark using 0xbench 2D on Nexus S (1 GHz)
       [before]
       Draw Rect:      28.52 fps


       [after]
       Draw Rect:         37.89 fps



This presentation takes the contributions in CyanogenMod
as example including SHA-1 hash
2D Improvement (2)
    external/skia/
    commit cb837750a37d59c979768320a7cf5ced96c7231c
        Add NEON optimized SkARGB32_Black_Blitter::blitMask


        Reference benchmark results on Nexus S (ARM Cortex-A8; 1 GHz) using
        skia_bench: (time in ms, smaller is better)
        [before]
        running bench [640 480]           text_48_linear_pos
          8888: cmsecs = 88.18
           565: cmsecs = 61.51
        running bench [640 480]               text_48_linear
          8888: cmsecs = 85.85
           565: cmsecs = 60.18


        [after]
        running   bench [640 480]         text_48_linear_pos
          8888:   cmsecs = 38.52
           565:   cmsecs = 59.11
        running   bench [640 480]            text_48_linear
          8888:   cmsecs = 36.24
           565:   cmsecs = 57.37
•
Benchmark: 2D (arm11-custom)
Benchmark: 3D (arm11-custom; no GPU)




This explains that we have several system tools and development flow
to help customers/community to verify the performance and improve.
3D/HW
Optimizing Graphics with 3D/HW

• The significant changes happen in applications and
  Android (Java) framework usage
  http://developer.android.com/guide/practices/design/performance.html

• Implement libgralloc carefully
   – Minimize the overhead of graphics memory
     allocator: the kernel helper
   – Example: UMP (Unified Memory Provider) in ARM
     Mali GPU
• Track the transactions inside SurfaceFlinger
   – Eliminate the invalid layer operations
   – Corresponding modifications in upper framework
• Still, page flipping benefits from libcopybit
  – but it has smaller difference with 3D/HW
Android Runtime
Arithmetic on Nexus S   Tune Dalvik VM performance (armv7)
Arithmetic Improvements
• Floating-point performance depends on Dalvik VM.
• Internally, Dalvik VM has huge amount of byte-swapped access,
  which can be improved by ARMv6's REV and REV16 instructions.
 bionic/
 commit 02bee5724266c447fc4699c00e70d2cd0c19f6e1
     Use ARMv6 instruction for handling byte order


     ARMv6 ISA has several instructions to handle data in different
     byte order.


 libcore/
 commit 7d5299b162863ea898dd863004afe79f7a93fbce
     Optimize byte-swapped accesses.


     Brings the performance of byte-swapped accesses way down from about
     3x to less than 2x worst-case (char/short) and 20% best-case
     (long/double). The main active ingredients are switching to a
     single-pass swapped-copy (rather than copy in one pass, swap
     in a second pass), and ensuring we use ARM's REV and REV16
     instructions.
bionic libc

• Android C/C++ library
• 0xlab/Linaro Optimizations (merged in AOSP)
  – Memory operations: Use ARMv6 unaligned access to
    optimize usual cases
     • Useful to TCP/IP (big-endian ↔ little endian)
  – Various ARM optimized functions
     • memcpy, strcmp, strcpy, memset, memcpy, strlen
     • sha1
     • code size reduction: useful for recovery image
Prelinking in GNU world
  (Quote from Embedded Linux optimizations – Size, RAM, speed,
  power, cost by Michael Opdenacker
  Thomas Petazzoni, Free Electrons)
• prelink
  http://people.redhat.com/jakub/prelink/
• prelink modifies executables and shared libraries to
  simplify the dynamic linker relocation work.
• This can greatly reduce startup time for big applications
  (50% less for KDE!). This also saves memory consumed
  by relocations.
• Can be used to reduce the startup time of a Linux system.
• Just needs to be run again when libraries or executables
  are updated.
  Details on http://elinux.org/Pre_Linking
Dynamic Linker Optimization:
                                  Why and How?
• The major reason to optimize dynamic linker is to
  speed up application startup time.
• Approaches:
   ● Implement GNU style hash support for bionic

     linker
   ● Prelinker improvements: incremental global

     prelinking
       –   reduce the number of ELF symbol lookup
           aggressively
• Changed parts
  – apriori, soslim, linker, elfcopy, elfutils
(normalized) Dynamic Link time

 1
0.9
0.8
0.7
0.6
                                                                                                                            lp
0.5
                                                                                                                            gp
0.4                                                                                                                         re.gp
0.3                                                                                                                         re.pe.gp
0.2                                                                                                                         re.pe.pgp.gp
                                                                                                                            re.pe.pgp.gp.are
0.1
 0
              ation




                                              ess
                              ver




                                                                                                          rild


                                                                                                                      lld
                                                                        on


                                                                                 ggerd



                                                                                                      r
                                                         ore




                                                                                                  nage




                                                                                                                 insta
                                                                   -daem
                         iaser


                                         proc


                                                    keyst
          anim




                                                                             debu


                                                                                              cema
                                    app_
                      med




                                                               dbus
      boot




                                                                                         servi
(normalized) Symbol Lookup number

  1


0.8


0.6
                                                                                                                         elf.lp
                                                                                                                         elf.gp
0.4                                                                                                                      elf.re.gp
                                                                                                                         elf.re.pe.gp
0.2                                                                                                                      elf.re.pe.pgp.gp
                                                                                                                         elf.re.pe.pgp.gp.are

  0
                                                                     on
                                         ess




                                                                              ggerd




                                                                                                       rild


                                                                                                                   lld
               ation




                                                      ore
                               ver




                                                                                                   r
                                                                                               nage




                                                                                                              insta
                                                                -daem
                          iaser


                                          proc


                                                 keyst
           anim




-0.2
                                                                          debu


                                                                                           cema
                                     app_
                       med




                                                            dbus
       boot




                                                                                      servi
• DT_GNU_HASH: visible dynamic linking improvement =
    Better hash function (few collisions)
    + Drop unnecessary entry from hash
    + Bloom filter

                     void foo (){
    libc.so            printf(“fooooo”);
     printf            bar();
                     }


   libfoo.so
      foo
      bar


                        libfoo.so
          DT_GNU_HASH               DT_HASH
         foo                        foo
         bar                        bar
                                    printf
Symbols lookup#    fail#      gnu hash filtered by bloom
                 in ELF
     gnu.gp         3758    23702      19950      23310              18234 (78%)

     gnu.gp.re      3758    20544      16792      19604              14752 (75%)

     gnu.lp        61750   460996    399252     450074              345032 (76%)

     gnu.lp.re     61750   481626    419882     448492              342378 (76%)



                                            H = {x, y, z} = hash functions
                                            Hash function may collision
                                              → Bloom filter may got false positives
Bit array




NOTE: Android 4.0 removes the support of prelinker,
but gnu style hash is still useful.
Case Study: WebKit in Android

                event
WebCore                  Refresh the surface
                         (expose event)


                        Android.webkit.WebViewCore
                          android.webkit.WebView
          Skia bridge
          Skia bridge                ...

       WebKit
                                                    JNI
                                                    JNI
  v8
  v8
                         skia


                                          Surface
How to Measure On Android/ARM?
 • for Native libraries →
    • Use 'perf' built without libperl, libpython
    • oprofiled and opcontrol are there, CPU data is
      missing
    • Binaries for ARM need frame pointers to have
      backtraces
 • Java part is the performance hell always.
    • traceview is a great tool for Java performance
      analysis.
    • JVMTI / JDWP (Java Debug Wire Protocol, normally
     spoken between a VM and a debugger)
# Overhead           Command           Shared Object      Symbol
# ........   ...............   .....................      ......
#
    89.23%     system_server                     2b0c6c   [.]   0x000000002b0c6c
     1.26%      MLVdo_thread   [kernel_helper]            [k]   0x0000000017aa90
     1.05%   d.process.acore   libskia.so                 [.]   S32A_Opaque_BlitRow32_arm
     0.83%   d.process.acore   libcutils.so               [.]   android_memset32
     0.63%     system_server   libc.so                    [.]   memcpy
     0.63%   d.process.acore   libc.so                    [.]   memset


system_server is the process name of Android
Framework runtime. It occupies most of CPU
resources, but it is hard to figure out details
only by native tools like perf.

                   We can always optimize known performance hotspot
                   routines such as S32A_Opaque_BlitRow32_arm but
                   should be measured in advance.
Traceview (java)
Approaches to Optimize WebKit

• Cherry-pick upstream enhancements
  – Example: ARM NEON optimized renderer and blur
    effects
• Track JNI bridge in WebKit – Avoid memory leaks
• Use hardware accelerated backing store for certain
  UI actions such as scrolling
   – Check Qualcomm's QAEP
• Image caching in both skia and webkit
• Since skia supports GL backend, webkit can utilize
  the accelerated paths
   – That's what Android 4.0 emphasize on.
Case Study: Profiling JNI

• Aprof : an Android profiler (by 0xlab, android-
  platform@ mailing-list)
   – a profiling tool for Android native code; aprof is not
     only another gprof implement on Android but also
     support for profiling shared
• The capability of aprof is similar to what gprof does, it
  provides call graph and time sampling profiling, but
  it's incompatible with gprof since the gprof can not
  profile shared library.
   – Limited by its representation and the fact of bionic
      libc incompatibility with GNU world.
• Integrated with Android activity life-cycle
Aprof




 %      cumulative   self               self      total
time     time        time     calls   ms/call   ms/call   name
99.52       2170     2140   2178309         0         0   fib
 0.00       2170        0         1         0       217   main
 0.48           0      30         0         0         0   <libc.so>
Android.mk
LOCAL_ENABLE_APROF := true
Android Boot Time Optimizations
Reducing Boot-Time is Art

      • You have to take every piece of boot flow into
        consideration.
      • Linux Kernel itself usually contributes less time than
        userspace.




Bootchart of Android 4.0 on Nexus S
We will focus on reducing “cold” boot time,
from power on to the execution of the system application.
Write Tiny Boot loader to Speed up
                                                       Qi           U-Boot + XLoader
                                                       Boot-oader
                                      Size             ~30K         ~270K+20K
Qi Boot-loader                        Time to Kernel   <1s          > 5s

   Only one stage boot-loader        Usage            Product      Engineering

                                      Code             Simple       Complicated
   Small footprint ~30 KB
   Currently support
    −   Freescale iMX31               Romcode
                                       ROM                          Romcode
                                                                     ROM
    −   Samsung S3C24xx
    −   Beagleboard
                                      XLoader                              Qi
   KISS concept
    −   Boot device and load kernel
    −   3 second reduction!            U-boot
                                       Uboot                          Linux


                                        Linux
                                                       TI OMAP3
Optimized ARM Hibernation
     • Based on existing technologies and little
       modifications to userspace are required
       – TuxOnIce
     • Release clean-pages before suspend
     • Swap out dirty-pages before save image
     • Image size reduced leads to faster resume time.




Demo video: http://www.youtube.com/watch?v=pvcQiiikJDU
Beagleboard-xM (OMAP3)
Full source tree: http://gitorious.org/0xlab-kernel
Further Boot Time Optimizations
       • Save the heap image (like core dump) of Zygote
         after preloading classes
       • Modify Dalvik to make hibernation image after
         system init and before Launcher startup
       • Parallize Android init
       • Cache & share JIT'ed code fragment




Reference: File-Based Sharing For Dynamically Compiled Code
On Dalvik Virtual Machine, National Chiao Tung University in Taiwan
Improper Ethernet
                              bring-up blocking




Initial bootchart analysis:
Initial bootchart analysis:
(1) It takes 27s from HW reset to Android Launcher screen.
(1) It takes 27s from HW reset to Android Launcher screen.
(2) There is an improper Ethernet bring-up blocking for 2s.
(2) There is an improper Ethernet bring-up blocking for 2s.
(3) CPU usage looks busy.
(3) CPU usage looks busy.
Reduced from 27s to 22s
                                        Android Launcher appears
                                        earlier then previous scenario.




                                   Remove “preloaded-classes" to
                                   Remove “preloaded-classes" to
                                   eliminate the time cost from Zygote
                                   eliminate the time cost from Zygote
Remove unnecessary dependency
 Remove unnecessary dependency     Risk: potentially slower Android
                                   Risk: potentially slower Android
to active services concurrently
 to active services concurrently   activity launch time
                                   activity launch time
Reduce boot time without Hibernation

• Zygote (init2) takes a long time to initialize Dalvik
  VM and Android framework, which are usually of
  the same context in virtual memory view
• If we can capture the state of a running process in
  Linux and save it to a file. This file can then be used
  to resume the process later on, either after a reboot
  or even on another machine.
      http://cryopid.berlios.de/
      https://ftg.lbl.gov/projects/CheckpointRestart/
      http://dmtcp.sourceforge.net/
• Only not zygote can benefit from from process
  freezing technique, but also system robustness
  might be improved.
Conclusion

• Optimizing Android requires the collaboration from
  community – verification, utilities, and upsteam
• UX is not as simple as its length.
   – Always Do measurement before taking actions
   – Hacking around the software stack
• Automated testing + continuous integration is
  really important.
http://0xlab.org

More Related Content

What's hot

F9: A Secure and Efficient Microkernel Built for Deeply Embedded Systems
F9: A Secure and Efficient Microkernel Built for Deeply Embedded SystemsF9: A Secure and Efficient Microkernel Built for Deeply Embedded Systems
F9: A Secure and Efficient Microkernel Built for Deeply Embedded SystemsNational Cheng Kung University
 
Project meeting: Android Graphics Architecture Overview
Project meeting: Android Graphics Architecture OverviewProject meeting: Android Graphics Architecture Overview
Project meeting: Android Graphics Architecture OverviewYu-Hsin Hung
 
U boot porting guide for SoC
U boot porting guide for SoCU boot porting guide for SoC
U boot porting guide for SoCMacpaul Lin
 
Binderのはじめの一歩とAndroid
Binderのはじめの一歩とAndroidBinderのはじめの一歩とAndroid
Binderのはじめの一歩とAndroidl_b__
 
Learning AOSP - Android Booting Process
Learning AOSP - Android Booting ProcessLearning AOSP - Android Booting Process
Learning AOSP - Android Booting ProcessNanik Tolaram
 
Linux Kernel MMC Storage driver Overview
Linux Kernel MMC Storage driver OverviewLinux Kernel MMC Storage driver Overview
Linux Kernel MMC Storage driver OverviewRajKumar Rampelli
 
Linux Kernel Module - For NLKB
Linux Kernel Module - For NLKBLinux Kernel Module - For NLKB
Linux Kernel Module - For NLKBshimosawa
 
Android Boot Time Optimization
Android Boot Time OptimizationAndroid Boot Time Optimization
Android Boot Time OptimizationKan-Ru Chen
 
Static partitioning virtualization on RISC-V
Static partitioning virtualization on RISC-VStatic partitioning virtualization on RISC-V
Static partitioning virtualization on RISC-VRISC-V International
 
introduction to linux kernel tcp/ip ptocotol stack
introduction to linux kernel tcp/ip ptocotol stack introduction to linux kernel tcp/ip ptocotol stack
introduction to linux kernel tcp/ip ptocotol stack monad bobo
 
U-Boot Porting on New Hardware
U-Boot Porting on New HardwareU-Boot Porting on New Hardware
U-Boot Porting on New HardwareRuggedBoardGroup
 

What's hot (20)

Learn C Programming Language by Using GDB
Learn C Programming Language by Using GDBLearn C Programming Language by Using GDB
Learn C Programming Language by Using GDB
 
F9: A Secure and Efficient Microkernel Built for Deeply Embedded Systems
F9: A Secure and Efficient Microkernel Built for Deeply Embedded SystemsF9: A Secure and Efficient Microkernel Built for Deeply Embedded Systems
F9: A Secure and Efficient Microkernel Built for Deeply Embedded Systems
 
Project meeting: Android Graphics Architecture Overview
Project meeting: Android Graphics Architecture OverviewProject meeting: Android Graphics Architecture Overview
Project meeting: Android Graphics Architecture Overview
 
U boot porting guide for SoC
U boot porting guide for SoCU boot porting guide for SoC
U boot porting guide for SoC
 
Android Binder: Deep Dive
Android Binder: Deep DiveAndroid Binder: Deep Dive
Android Binder: Deep Dive
 
Linux Kernel I/O Schedulers
Linux Kernel I/O SchedulersLinux Kernel I/O Schedulers
Linux Kernel I/O Schedulers
 
Design and Concepts of Android Graphics
Design and Concepts of Android GraphicsDesign and Concepts of Android Graphics
Design and Concepts of Android Graphics
 
Binderのはじめの一歩とAndroid
Binderのはじめの一歩とAndroidBinderのはじめの一歩とAndroid
Binderのはじめの一歩とAndroid
 
Learning AOSP - Android Booting Process
Learning AOSP - Android Booting ProcessLearning AOSP - Android Booting Process
Learning AOSP - Android Booting Process
 
Microkernel Evolution
Microkernel EvolutionMicrokernel Evolution
Microkernel Evolution
 
Explore Android Internals
Explore Android InternalsExplore Android Internals
Explore Android Internals
 
Linux Kernel MMC Storage driver Overview
Linux Kernel MMC Storage driver OverviewLinux Kernel MMC Storage driver Overview
Linux Kernel MMC Storage driver Overview
 
Linux Kernel Module - For NLKB
Linux Kernel Module - For NLKBLinux Kernel Module - For NLKB
Linux Kernel Module - For NLKB
 
Android Boot Time Optimization
Android Boot Time OptimizationAndroid Boot Time Optimization
Android Boot Time Optimization
 
Embedded Linux Kernel - Build your custom kernel
Embedded Linux Kernel - Build your custom kernelEmbedded Linux Kernel - Build your custom kernel
Embedded Linux Kernel - Build your custom kernel
 
Static partitioning virtualization on RISC-V
Static partitioning virtualization on RISC-VStatic partitioning virtualization on RISC-V
Static partitioning virtualization on RISC-V
 
Embedded Virtualization applied in Mobile Devices
Embedded Virtualization applied in Mobile DevicesEmbedded Virtualization applied in Mobile Devices
Embedded Virtualization applied in Mobile Devices
 
Low Level View of Android System Architecture
Low Level View of Android System ArchitectureLow Level View of Android System Architecture
Low Level View of Android System Architecture
 
introduction to linux kernel tcp/ip ptocotol stack
introduction to linux kernel tcp/ip ptocotol stack introduction to linux kernel tcp/ip ptocotol stack
introduction to linux kernel tcp/ip ptocotol stack
 
U-Boot Porting on New Hardware
U-Boot Porting on New HardwareU-Boot Porting on New Hardware
U-Boot Porting on New Hardware
 

Similar to Improve Android System Component Performance

Develop Community-based Android Distribution and Upstreaming Experience
Develop Community-based Android Distribution and Upstreaming Experience Develop Community-based Android Distribution and Upstreaming Experience
Develop Community-based Android Distribution and Upstreaming Experience National Cheng Kung University
 
Build Community Android Distribution and Ensure the Quality
Build Community Android Distribution and Ensure the QualityBuild Community Android Distribution and Ensure the Quality
Build Community Android Distribution and Ensure the QualityNational Cheng Kung University
 
Introduction to Android- A session by Sagar Das
Introduction to Android-  A session by Sagar DasIntroduction to Android-  A session by Sagar Das
Introduction to Android- A session by Sagar Dasdscfetju
 
Slides bootcamp21
Slides bootcamp21Slides bootcamp21
Slides bootcamp21dxsaki
 
Matteo Gazzurelli - Introduction to Android Development - Have a break edition
Matteo Gazzurelli - Introduction to Android Development - Have a break editionMatteo Gazzurelli - Introduction to Android Development - Have a break edition
Matteo Gazzurelli - Introduction to Android Development - Have a break editionDuckMa
 
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013DuckMa
 
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_osEnhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_osArnav Gupta
 
.NET? MonoDroid Does
.NET? MonoDroid Does.NET? MonoDroid Does
.NET? MonoDroid DoesKevin McMahon
 
0xdroid -- community-developed Android distribution by 0xlab
0xdroid -- community-developed Android distribution by 0xlab0xdroid -- community-developed Android distribution by 0xlab
0xdroid -- community-developed Android distribution by 0xlabNational Cheng Kung University
 
Android application development
Android application developmentAndroid application development
Android application developmentLinh Vi Tường
 
Crosswalk and the Intel XDK
Crosswalk and the Intel XDKCrosswalk and the Intel XDK
Crosswalk and the Intel XDKIntel® Software
 
Seminar on android app development
Seminar on android app developmentSeminar on android app development
Seminar on android app developmentAbhishekKumar4779
 
Android – As a tool of innovation
Android – As a tool of innovation Android – As a tool of innovation
Android – As a tool of innovation Pallab Sarkar
 
Deep Dive Into Android Security
Deep Dive Into Android SecurityDeep Dive Into Android Security
Deep Dive Into Android SecurityMarakana Inc.
 

Similar to Improve Android System Component Performance (20)

Develop Community-based Android Distribution and Upstreaming Experience
Develop Community-based Android Distribution and Upstreaming Experience Develop Community-based Android Distribution and Upstreaming Experience
Develop Community-based Android Distribution and Upstreaming Experience
 
Build Community Android Distribution and Ensure the Quality
Build Community Android Distribution and Ensure the QualityBuild Community Android Distribution and Ensure the Quality
Build Community Android Distribution and Ensure the Quality
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
 
Introduction to Android- A session by Sagar Das
Introduction to Android-  A session by Sagar DasIntroduction to Android-  A session by Sagar Das
Introduction to Android- A session by Sagar Das
 
Slides bootcamp21
Slides bootcamp21Slides bootcamp21
Slides bootcamp21
 
My androidpresentation
My androidpresentationMy androidpresentation
My androidpresentation
 
Matteo Gazzurelli - Introduction to Android Development - Have a break edition
Matteo Gazzurelli - Introduction to Android Development - Have a break editionMatteo Gazzurelli - Introduction to Android Development - Have a break edition
Matteo Gazzurelli - Introduction to Android Development - Have a break edition
 
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013
 
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_osEnhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
 
Android session-1-sajib
Android session-1-sajibAndroid session-1-sajib
Android session-1-sajib
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
 
01 03 - introduction to android
01  03 - introduction to android01  03 - introduction to android
01 03 - introduction to android
 
.NET? MonoDroid Does
.NET? MonoDroid Does.NET? MonoDroid Does
.NET? MonoDroid Does
 
0xdroid -- community-developed Android distribution by 0xlab
0xdroid -- community-developed Android distribution by 0xlab0xdroid -- community-developed Android distribution by 0xlab
0xdroid -- community-developed Android distribution by 0xlab
 
Android application development
Android application developmentAndroid application development
Android application development
 
Android Optimization: Myth and Reality
Android Optimization: Myth and RealityAndroid Optimization: Myth and Reality
Android Optimization: Myth and Reality
 
Crosswalk and the Intel XDK
Crosswalk and the Intel XDKCrosswalk and the Intel XDK
Crosswalk and the Intel XDK
 
Seminar on android app development
Seminar on android app developmentSeminar on android app development
Seminar on android app development
 
Android – As a tool of innovation
Android – As a tool of innovation Android – As a tool of innovation
Android – As a tool of innovation
 
Deep Dive Into Android Security
Deep Dive Into Android SecurityDeep Dive Into Android Security
Deep Dive Into Android Security
 

More from National Cheng Kung University

PyPy's approach to construct domain-specific language runtime
PyPy's approach to construct domain-specific language runtimePyPy's approach to construct domain-specific language runtime
PyPy's approach to construct domain-specific language runtimeNational Cheng Kung University
 
進階嵌入式作業系統設計與實做 (2015 年秋季 ) 課程說明
進階嵌入式作業系統設計與實做 (2015 年秋季 ) 課程說明進階嵌入式作業系統設計與實做 (2015 年秋季 ) 課程說明
進階嵌入式作業系統設計與實做 (2015 年秋季 ) 課程說明National Cheng Kung University
 
給自己更好未來的 3 個練習:嵌入式作業系統設計、實做,與移植 (2015 年春季 ) 課程說明
給自己更好未來的 3 個練習:嵌入式作業系統設計、實做,與移植 (2015 年春季 ) 課程說明給自己更好未來的 3 個練習:嵌入式作業系統設計、實做,與移植 (2015 年春季 ) 課程說明
給自己更好未來的 3 個練習:嵌入式作業系統設計、實做,與移植 (2015 年春季 ) 課程說明National Cheng Kung University
 
進階嵌入式系統開發與實做 (2014 年秋季 ) 課程說明
進階嵌入式系統開發與實做 (2014 年秋季 ) 課程說明進階嵌入式系統開發與實做 (2014 年秋季 ) 課程說明
進階嵌入式系統開發與實做 (2014 年秋季 ) 課程說明National Cheng Kung University
 
Develop Your Own Operating Systems using Cheap ARM Boards
Develop Your Own Operating Systems using Cheap ARM BoardsDevelop Your Own Operating Systems using Cheap ARM Boards
Develop Your Own Operating Systems using Cheap ARM BoardsNational Cheng Kung University
 
Lecture notice about Embedded Operating System Design and Implementation
Lecture notice about Embedded Operating System Design and ImplementationLecture notice about Embedded Operating System Design and Implementation
Lecture notice about Embedded Operating System Design and ImplementationNational Cheng Kung University
 
中輟生談教育: 完全用開放原始碼軟體進行 嵌入式系統教學
中輟生談教育: 完全用開放原始碼軟體進行 嵌入式系統教學中輟生談教育: 完全用開放原始碼軟體進行 嵌入式系統教學
中輟生談教育: 完全用開放原始碼軟體進行 嵌入式系統教學National Cheng Kung University
 

More from National Cheng Kung University (20)

PyPy's approach to construct domain-specific language runtime
PyPy's approach to construct domain-specific language runtimePyPy's approach to construct domain-specific language runtime
PyPy's approach to construct domain-specific language runtime
 
Making Linux do Hard Real-time
Making Linux do Hard Real-timeMaking Linux do Hard Real-time
Making Linux do Hard Real-time
 
2016 年春季嵌入式作業系統課程說明
2016 年春季嵌入式作業系統課程說明2016 年春季嵌入式作業系統課程說明
2016 年春季嵌入式作業系統課程說明
 
Interpreter, Compiler, JIT from scratch
Interpreter, Compiler, JIT from scratchInterpreter, Compiler, JIT from scratch
Interpreter, Compiler, JIT from scratch
 
進階嵌入式作業系統設計與實做 (2015 年秋季 ) 課程說明
進階嵌入式作業系統設計與實做 (2015 年秋季 ) 課程說明進階嵌入式作業系統設計與實做 (2015 年秋季 ) 課程說明
進階嵌入式作業系統設計與實做 (2015 年秋季 ) 課程說明
 
Construct an Efficient and Secure Microkernel for IoT
Construct an Efficient and Secure Microkernel for IoTConstruct an Efficient and Secure Microkernel for IoT
Construct an Efficient and Secure Microkernel for IoT
 
The Internals of "Hello World" Program
The Internals of "Hello World" ProgramThe Internals of "Hello World" Program
The Internals of "Hello World" Program
 
How A Compiler Works: GNU Toolchain
How A Compiler Works: GNU ToolchainHow A Compiler Works: GNU Toolchain
How A Compiler Works: GNU Toolchain
 
給自己更好未來的 3 個練習:嵌入式作業系統設計、實做,與移植 (2015 年春季 ) 課程說明
給自己更好未來的 3 個練習:嵌入式作業系統設計、實做,與移植 (2015 年春季 ) 課程說明給自己更好未來的 3 個練習:嵌入式作業系統設計、實做,與移植 (2015 年春季 ) 課程說明
給自己更好未來的 3 個練習:嵌入式作業系統設計、實做,與移植 (2015 年春季 ) 課程說明
 
從線上售票看作業系統設計議題
從線上售票看作業系統設計議題從線上售票看作業系統設計議題
從線上售票看作業系統設計議題
 
進階嵌入式系統開發與實做 (2014 年秋季 ) 課程說明
進階嵌入式系統開發與實做 (2014 年秋季 ) 課程說明進階嵌入式系統開發與實做 (2014 年秋季 ) 課程說明
進階嵌入式系統開發與實做 (2014 年秋季 ) 課程說明
 
Xvisor: embedded and lightweight hypervisor
Xvisor: embedded and lightweight hypervisorXvisor: embedded and lightweight hypervisor
Xvisor: embedded and lightweight hypervisor
 
Making Linux do Hard Real-time
Making Linux do Hard Real-timeMaking Linux do Hard Real-time
Making Linux do Hard Real-time
 
Implement Runtime Environments for HSA using LLVM
Implement Runtime Environments for HSA using LLVMImplement Runtime Environments for HSA using LLVM
Implement Runtime Environments for HSA using LLVM
 
Priority Inversion on Mars
Priority Inversion on MarsPriority Inversion on Mars
Priority Inversion on Mars
 
Develop Your Own Operating Systems using Cheap ARM Boards
Develop Your Own Operating Systems using Cheap ARM BoardsDevelop Your Own Operating Systems using Cheap ARM Boards
Develop Your Own Operating Systems using Cheap ARM Boards
 
Lecture notice about Embedded Operating System Design and Implementation
Lecture notice about Embedded Operating System Design and ImplementationLecture notice about Embedded Operating System Design and Implementation
Lecture notice about Embedded Operating System Design and Implementation
 
中輟生談教育: 完全用開放原始碼軟體進行 嵌入式系統教學
中輟生談教育: 完全用開放原始碼軟體進行 嵌入式系統教學中輟生談教育: 完全用開放原始碼軟體進行 嵌入式系統教學
中輟生談教育: 完全用開放原始碼軟體進行 嵌入式系統教學
 
Open Source from Legend, Business, to Ecosystem
Open Source from Legend, Business, to EcosystemOpen Source from Legend, Business, to Ecosystem
Open Source from Legend, Business, to Ecosystem
 
Summer Project: Microkernel (2013)
Summer Project: Microkernel (2013)Summer Project: Microkernel (2013)
Summer Project: Microkernel (2013)
 

Recently uploaded

Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 

Recently uploaded (20)

Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 

Improve Android System Component Performance

  • 1. Improve Android System Component Performance Jim Huang ( 黃敬群 ) <jserv@0xlab.org> Developer & Co-Founder, 0xlab http://0xlab.org/ Feb 14, 2012 / Android Builders Summit
  • 2. Rights to copy © Copyright 2012 0xlab http://0xlab.org/ contact@0xlab.org Attribution – ShareAlike 3.0 You are free Corrections, suggestions, and contributions are welcome! to copy, distribute, display, and perform the work to make derivative works Latest update: Feb 14, 2012 to make commercial use of the work Under the following conditions Attribution. You must give the original author credit. Share Alike. If you alter, transform, or build upon this work, you may distribute the resulting work only under a license identical to this one. For any reuse or distribution, you must make clear to others the license terms of this work. Any of these conditions can be waived if you get permission from the copyright holder. Your fair use and other rights are in no way affected by the above. License text: http://creativecommons.org/licenses/by-sa/3.0/legalcode
  • 3. 0x1ab = 162 + 16x10 + 11 = 427 (founded on April 27, 2009) 0xlab is another Hexspeak. (pronounce: zero-aks-lab)
  • 4. About Me (1) Come from Taiwan (2) Contributor of Android Open Source Project (AOSP) (3) Developer, Linaro (4) Focus: system performance and virtualization at 0xlab
  • 5. Mission of 0xlab development: Improve UX in SoC UX = User Experience SoC = Integrated Computing Anywhere
  • 6. Strategy and Policy • open source efforts to improve AOSP • We focus on small-but-important area of Android. – toolchain, libc, dynamic linker, skia, GLES, system libraries, HAL • Develop system utilities for Android – benchmark, black-box testing tool, validation infrastructure • Value-added features – Faster boot/startup time, Bluetooth profile, visual enhancements • Submit and share changes to community – AOSP, CyanogenMod, Android-x86 – Linaro
  • 7. Working Model Rowboat CyanogenMod Android-x86
  • 8. Hidden Bugs in AOSP • AOSP is dedicated to mobile Lucky! product devices shipped by OHA members We– Fixed hardware "bug" in Android accidently encountered the and specifications – Not well verified for other configurations • Performance is important, but we frequently hit the hidden bugs when apply aggressive optimizations. – Quality is the first priority!
  • 9. Quality in custom Android Distribution • 0xlab delivers the advantages of open source software and development. – Quality relies on two factors: continuous development + strong user feedback • Several utilities are developed to ensure the quality and released as open source software. – 0xbench (Android benchmarking tool) – ASTER (Android System Testing Environment and Runtime) – LAVA (Linaro Automated Validation Architecture) • In the meanwhile, performance is improved by several patches against essential components. Tip: Automate system before optimizing
  • 10. LAVA: Automated Validation Infrastructure for Android Android benchmark running on LAVA. Android support on LAVA Automated Validation flow includes https://wiki.linaro.org/Platform/Validation/LAVA from deploy, then reboot, testing, benchmark running, and result submit. Android related commands in LAVA: * deploy_linaro_android_image * boot_linaro_android_image * test_android_basic * test_android_monkey * test_android_0xbench * submit_results_on_host Check "LAVA Project Update" by Paul Larson, 2012 Embedded Linux Conference
  • 11. 0xbench: comprehensive open source benchmark suite for Android • A set of system utilities for Android to perform comprehensive system benchmarking • Dalvik VM performance • OpenGL|ES performance • Android Graphics framework performance • I/O performance • JavaScript engine performance • Connectivity performance • Micro-benchmark: stanard C library, system call, latency, Java invocation, ... Project page: http://code.google.com/p/0xbench/
  • 13. Collect and Analyze results on server-side
  • 14. Android Functional Testing • stress test – Utilizing 'monkey', which is part of framework • Automated test – Both blackbox-test and whitebox-test are required
  • 15. Stress Test • According to CDD (Compatibility Definition Document), Device implementations MUST include the Monkey framework, and make it available for applications to use. • monkey is a command that can directly talks to Android framework and emulate random user input. adb shell monkey ­p your.package.name ­v 500 • Decide the percentage of touch events, keybord events, etc., then run automatically.
  • 16. ASTER: Automated Test • Blackbox-test vs. Whitebox-test • An easy to use automated testing tool with IDE – Built upon MoneyRunner • Batch execution of visual test scripts • Multiple chains of recall commands • Designed for non-programmer or Q&A engineers • Use OpenCV to recognize icons or UI hints Project page: http://code.google.com/p/aster/
  • 17.
  • 19. ASTER IDE in 2011
  • 20. It is time to improve the performance of Android system components
  • 21. No Silver Bullet to Improve the whole
  • 22. Possibly Premature optimizations in Android • “Premature optimization is the root of all evil” – Donald Knuth • bionic libc – glibc incompatibility, No SysV IPC, partial Pthread, incomplete prelink – inactive/incorrect kernel header inclusion – May not re-use existing system utilities • Assumed UI behavior – Input event dispatching and handler – Strict / non-maintainable state machine (policy) – Depending on a certain set of peripherals • Unclear HAL design and interface – Wifi, Bluetooth, GPS, ...
  • 23. Think Difficult • To make performance improvement visible – Modifications from Application level, Android framework, system libraries, and kernel • Slowdown in newer Android version – Example: Graphics in Eclair (2.0/2.1) is much slower than 1.5 or 1.6 • To optimize or not to optimize, that is the question. – Merge Local optimizations != Optimized globally – Many Android applications don't take various devices into consideration. Thus, performance issues occur all the way.
  • 24. Which parts will be Improved? • 2D/3D Graphics • Android Runtime • Boot time Three frequently mentioned items in Android engineering are selected as the entry points: 2D/3D graphics, runtime, and boot time.
  • 26. Functional View (1.5) Applications Applications Gallery Phone Web Browser Google Maps ・・・・・ Android Framework Android Framework Activity Window Content Notification View System Manager Manager Manager Manager Package Telephony Resource Location Manager Manager Manager Manager System Library System Library Android Runtime Android Runtime SurfaceFlinger SurfaceFlinger OpenCORE OpenCORE SQLite Class Library Dalvik Virtual Machine Dalvik Virtual Machine OpenGL|ES OpenGL|ES AudioFlinger AudioFlinger WebKit SGL SGL OpenSSL bionic libc bionic libc Freetype Linux Kernel Linux Kernel
  • 27. Functional View (2.3) Applications Applications Gallery Phone Web Browser Google Maps ・・・・・ Android Framework Android Framework Activity Window Content Notification View System Manager Manager Manager Manager Package Telephony Resource Location Manager Manager Manager Manager RenderScript OpenGL|ES 2.x accelerated. System Library System Library Android Runtime Android Runtime Drop 2D accel SurfaceFlinger SurfaceFlinger StageFright SQLite Class Library V8 bridge Dalvik Virtual Machine Dalvik Virtual Machine GLES 2.0 OpenGL|ES OpenGL|ES AudioFlinger AudioFlinger WebKit SMP improvements Skia Skia OpenSSL bionic libc bionic libc Freetype JIT compiler Skia supports GPU backend SMP fixes In Android 3.x Linux Kernel Linux Kernel
  • 28. Properties Android SurfaceFlinger  Can combine 2D/3D surfaces and surfaces from multiple applications  Surfaces passed as buffers via Binder IPC calls  Can use OpenGL ES and 2D hardware accelerator for its compositions  Double-buffering using page-flip
  • 29.
  • 30. from EGL to SurfaceFlinger hgl = hardware hgl = hardware agl = android software agl = android software OpenGL|ES OpenGL|ES OpenGL|ES renderer OpenGL|ES renderer
  • 31.
  • 32. Android Graphics without OpenGL|ES Hardware Android Framework (Java) EventHub libandroid_runtime Surfaceflinger Copybit (service) (HW accelerated) Renamed to libgui Renamed to libgui in Android 4.0 in Android 4.0 libagl is an optimized GLES 1.x libagl is an optimized GLES 1.x libui libGLES Impl. Android 4.0 comes with libAgl2, Impl. Android 4.0 comes with libAgl2, (libagl) which provides software GL ES 2.0 which provides software GL ES 2.0 Implementation using Pixelflinger2 Implementation using Pixelflinger2 libpixelflinger libpixelflinger is software renderer libpixelflinger is software renderer Android 4.0 comes with a new implementation, Android 4.0 comes with a new implementation, When GLES doesn't work, When GLES doesn't work, PixelFlinger2, which Is based on LLVM and PixelFlinger2, which Is based on LLVM and software is used Mesa (glsl2-llvm): external/mesa3d Mesa (glsl2-llvm): external/mesa3d software is used
  • 33. 2D Accelerator for Android Graphics • libcopybit provides hareware bitblit operations which includes moving, scaling, rotation, mirroring, and more effects, like blending, dithering, bluring, etc. • Removed since Android 2.3 – But adding it back might improve UX in large screen. • Android has two copybit interfaces: – Blit: moving / blending – Stretch: scaling besides moving • libcopybit is called by libagl which can do swapBuffers to do the framebuffer page flipping that can also be accelerated by libcopybit. Copybit could improve the performance of page flipping Copybit could improve the performance of page flipping
  • 34. Copybit operations Copybit: 2D blitter Copybit: 2D blitter
  • 35. Optimizing Graphics without 3D/HW • Implement copybit HAL carefully – Minimize clip region – Eliminate data copy • Check ioctl for page flipping in framebuffer driver – Efficiency and consistency • Without 3D/HW, Android Graphics is CPU bound – Reduce the amount of surfaces to manipulate – Optimizing skia (2D vector library) is important – Optimize color space conversion – Optimize blitter and primitive operations like matrix using ARM VFP and NEON
  • 36. Apply extra performance tweaks against optimized build 2D on Nexus S (NEON)
  • 37. 2D Improvement (1) external/skia/ ccommit ae265ac7f132f5d475040edf134e312b3987eade Add NEON optimized blitter: RGB565 to ABGR8888 without filter and blending commit 4b9b68bb9b8f82d6f70d98449851bc4bb19958bd optimize blend32_16_row and unroll SkRGB16_Blitter::blitRect Reference benchmark using 0xbench 2D on Nexus S (1 GHz) [before] Draw Rect: 28.52 fps [after] Draw Rect: 37.89 fps This presentation takes the contributions in CyanogenMod as example including SHA-1 hash
  • 38. 2D Improvement (2) external/skia/ commit cb837750a37d59c979768320a7cf5ced96c7231c Add NEON optimized SkARGB32_Black_Blitter::blitMask Reference benchmark results on Nexus S (ARM Cortex-A8; 1 GHz) using skia_bench: (time in ms, smaller is better) [before] running bench [640 480] text_48_linear_pos 8888: cmsecs = 88.18 565: cmsecs = 61.51 running bench [640 480] text_48_linear 8888: cmsecs = 85.85 565: cmsecs = 60.18 [after] running bench [640 480] text_48_linear_pos 8888: cmsecs = 38.52 565: cmsecs = 59.11 running bench [640 480] text_48_linear 8888: cmsecs = 36.24 565: cmsecs = 57.37 •
  • 40. Benchmark: 3D (arm11-custom; no GPU) This explains that we have several system tools and development flow to help customers/community to verify the performance and improve.
  • 41. 3D/HW
  • 42. Optimizing Graphics with 3D/HW • The significant changes happen in applications and Android (Java) framework usage http://developer.android.com/guide/practices/design/performance.html • Implement libgralloc carefully – Minimize the overhead of graphics memory allocator: the kernel helper – Example: UMP (Unified Memory Provider) in ARM Mali GPU • Track the transactions inside SurfaceFlinger – Eliminate the invalid layer operations – Corresponding modifications in upper framework • Still, page flipping benefits from libcopybit – but it has smaller difference with 3D/HW
  • 44. Arithmetic on Nexus S Tune Dalvik VM performance (armv7)
  • 45. Arithmetic Improvements • Floating-point performance depends on Dalvik VM. • Internally, Dalvik VM has huge amount of byte-swapped access, which can be improved by ARMv6's REV and REV16 instructions. bionic/ commit 02bee5724266c447fc4699c00e70d2cd0c19f6e1 Use ARMv6 instruction for handling byte order ARMv6 ISA has several instructions to handle data in different byte order. libcore/ commit 7d5299b162863ea898dd863004afe79f7a93fbce Optimize byte-swapped accesses. Brings the performance of byte-swapped accesses way down from about 3x to less than 2x worst-case (char/short) and 20% best-case (long/double). The main active ingredients are switching to a single-pass swapped-copy (rather than copy in one pass, swap in a second pass), and ensuring we use ARM's REV and REV16 instructions.
  • 46. bionic libc • Android C/C++ library • 0xlab/Linaro Optimizations (merged in AOSP) – Memory operations: Use ARMv6 unaligned access to optimize usual cases • Useful to TCP/IP (big-endian ↔ little endian) – Various ARM optimized functions • memcpy, strcmp, strcpy, memset, memcpy, strlen • sha1 • code size reduction: useful for recovery image
  • 47. Prelinking in GNU world (Quote from Embedded Linux optimizations – Size, RAM, speed, power, cost by Michael Opdenacker Thomas Petazzoni, Free Electrons) • prelink http://people.redhat.com/jakub/prelink/ • prelink modifies executables and shared libraries to simplify the dynamic linker relocation work. • This can greatly reduce startup time for big applications (50% less for KDE!). This also saves memory consumed by relocations. • Can be used to reduce the startup time of a Linux system. • Just needs to be run again when libraries or executables are updated. Details on http://elinux.org/Pre_Linking
  • 48. Dynamic Linker Optimization: Why and How? • The major reason to optimize dynamic linker is to speed up application startup time. • Approaches: ● Implement GNU style hash support for bionic linker ● Prelinker improvements: incremental global prelinking – reduce the number of ELF symbol lookup aggressively • Changed parts – apriori, soslim, linker, elfcopy, elfutils
  • 49. (normalized) Dynamic Link time 1 0.9 0.8 0.7 0.6 lp 0.5 gp 0.4 re.gp 0.3 re.pe.gp 0.2 re.pe.pgp.gp re.pe.pgp.gp.are 0.1 0 ation ess ver rild lld on ggerd r ore nage insta -daem iaser proc keyst anim debu cema app_ med dbus boot servi
  • 50. (normalized) Symbol Lookup number 1 0.8 0.6 elf.lp elf.gp 0.4 elf.re.gp elf.re.pe.gp 0.2 elf.re.pe.pgp.gp elf.re.pe.pgp.gp.are 0 on ess ggerd rild lld ation ore ver r nage insta -daem iaser proc keyst anim -0.2 debu cema app_ med dbus boot servi
  • 51. • DT_GNU_HASH: visible dynamic linking improvement = Better hash function (few collisions) + Drop unnecessary entry from hash + Bloom filter void foo (){ libc.so printf(“fooooo”); printf bar(); } libfoo.so foo bar libfoo.so DT_GNU_HASH DT_HASH foo foo bar bar printf
  • 52. Symbols lookup# fail# gnu hash filtered by bloom in ELF gnu.gp 3758 23702 19950 23310 18234 (78%) gnu.gp.re 3758 20544 16792 19604 14752 (75%) gnu.lp 61750 460996 399252 450074 345032 (76%) gnu.lp.re 61750 481626 419882 448492 342378 (76%) H = {x, y, z} = hash functions Hash function may collision → Bloom filter may got false positives Bit array NOTE: Android 4.0 removes the support of prelinker, but gnu style hash is still useful.
  • 53. Case Study: WebKit in Android event WebCore Refresh the surface (expose event) Android.webkit.WebViewCore android.webkit.WebView Skia bridge Skia bridge ... WebKit JNI JNI v8 v8 skia Surface
  • 54. How to Measure On Android/ARM? • for Native libraries → • Use 'perf' built without libperl, libpython • oprofiled and opcontrol are there, CPU data is missing • Binaries for ARM need frame pointers to have backtraces • Java part is the performance hell always. • traceview is a great tool for Java performance analysis. • JVMTI / JDWP (Java Debug Wire Protocol, normally spoken between a VM and a debugger)
  • 55. # Overhead Command Shared Object Symbol # ........ ............... ..................... ...... # 89.23% system_server 2b0c6c [.] 0x000000002b0c6c 1.26% MLVdo_thread [kernel_helper] [k] 0x0000000017aa90 1.05% d.process.acore libskia.so [.] S32A_Opaque_BlitRow32_arm 0.83% d.process.acore libcutils.so [.] android_memset32 0.63% system_server libc.so [.] memcpy 0.63% d.process.acore libc.so [.] memset system_server is the process name of Android Framework runtime. It occupies most of CPU resources, but it is hard to figure out details only by native tools like perf. We can always optimize known performance hotspot routines such as S32A_Opaque_BlitRow32_arm but should be measured in advance.
  • 57.
  • 58. Approaches to Optimize WebKit • Cherry-pick upstream enhancements – Example: ARM NEON optimized renderer and blur effects • Track JNI bridge in WebKit – Avoid memory leaks • Use hardware accelerated backing store for certain UI actions such as scrolling – Check Qualcomm's QAEP • Image caching in both skia and webkit • Since skia supports GL backend, webkit can utilize the accelerated paths – That's what Android 4.0 emphasize on.
  • 59. Case Study: Profiling JNI • Aprof : an Android profiler (by 0xlab, android- platform@ mailing-list) – a profiling tool for Android native code; aprof is not only another gprof implement on Android but also support for profiling shared • The capability of aprof is similar to what gprof does, it provides call graph and time sampling profiling, but it's incompatible with gprof since the gprof can not profile shared library. – Limited by its representation and the fact of bionic libc incompatibility with GNU world. • Integrated with Android activity life-cycle
  • 60. Aprof % cumulative self self total time time time calls ms/call ms/call name 99.52 2170 2140 2178309 0 0 fib 0.00 2170 0 1 0 217 main 0.48 0 30 0 0 0 <libc.so>
  • 62. Android Boot Time Optimizations
  • 63. Reducing Boot-Time is Art • You have to take every piece of boot flow into consideration. • Linux Kernel itself usually contributes less time than userspace. Bootchart of Android 4.0 on Nexus S We will focus on reducing “cold” boot time, from power on to the execution of the system application.
  • 64. Write Tiny Boot loader to Speed up Qi U-Boot + XLoader Boot-oader Size ~30K ~270K+20K Qi Boot-loader Time to Kernel <1s > 5s  Only one stage boot-loader Usage Product Engineering Code Simple Complicated  Small footprint ~30 KB  Currently support − Freescale iMX31 Romcode ROM Romcode ROM − Samsung S3C24xx − Beagleboard XLoader Qi  KISS concept − Boot device and load kernel − 3 second reduction! U-boot Uboot Linux Linux TI OMAP3
  • 65. Optimized ARM Hibernation • Based on existing technologies and little modifications to userspace are required – TuxOnIce • Release clean-pages before suspend • Swap out dirty-pages before save image • Image size reduced leads to faster resume time. Demo video: http://www.youtube.com/watch?v=pvcQiiikJDU Beagleboard-xM (OMAP3) Full source tree: http://gitorious.org/0xlab-kernel
  • 66. Further Boot Time Optimizations • Save the heap image (like core dump) of Zygote after preloading classes • Modify Dalvik to make hibernation image after system init and before Launcher startup • Parallize Android init • Cache & share JIT'ed code fragment Reference: File-Based Sharing For Dynamically Compiled Code On Dalvik Virtual Machine, National Chiao Tung University in Taiwan
  • 67. Improper Ethernet bring-up blocking Initial bootchart analysis: Initial bootchart analysis: (1) It takes 27s from HW reset to Android Launcher screen. (1) It takes 27s from HW reset to Android Launcher screen. (2) There is an improper Ethernet bring-up blocking for 2s. (2) There is an improper Ethernet bring-up blocking for 2s. (3) CPU usage looks busy. (3) CPU usage looks busy.
  • 68. Reduced from 27s to 22s Android Launcher appears earlier then previous scenario. Remove “preloaded-classes" to Remove “preloaded-classes" to eliminate the time cost from Zygote eliminate the time cost from Zygote Remove unnecessary dependency Remove unnecessary dependency Risk: potentially slower Android Risk: potentially slower Android to active services concurrently to active services concurrently activity launch time activity launch time
  • 69. Reduce boot time without Hibernation • Zygote (init2) takes a long time to initialize Dalvik VM and Android framework, which are usually of the same context in virtual memory view • If we can capture the state of a running process in Linux and save it to a file. This file can then be used to resume the process later on, either after a reboot or even on another machine. http://cryopid.berlios.de/ https://ftg.lbl.gov/projects/CheckpointRestart/ http://dmtcp.sourceforge.net/ • Only not zygote can benefit from from process freezing technique, but also system robustness might be improved.
  • 70. Conclusion • Optimizing Android requires the collaboration from community – verification, utilities, and upsteam • UX is not as simple as its length. – Always Do measurement before taking actions – Hacking around the software stack • Automated testing + continuous integration is really important.