TPEPlatform/Graphic

From MozillaWiki
Jump to navigation Jump to search

Rendering performance analysis

Basic steps

For rendering performance evaluation, here are things that you should know/ do, before looking deeper into a specific module.

  • Get rid of touch event
    • In the beginning of device enabling, touch event reporting is not stable. Try to use automatic animation, instead of paning gesture.
    • (*): We should construct several apps with simple animation, such as 50 sprites move on the screen, full screen 2D canvas with reasonable drawing actions.
  • FPS
    • How to get FPS?
  • Repainting
    • The definition of repainting
    • How to check repainting?
  • CPU usage on content and chrome(B2G) process
    • adb shell top -s cpu -m 10 -t
  • Big question: CPU bound or GPU bound
    • Where, I mean which module, we use GPU?
    • How to make sure the platform, we are looking, is not GPU bound? Generically, most case are CPU bound, unless graphic/ display driver is suck or user choose a GPU intense application, such as 2D or 3D games.
  • Chrome or Content process CPU bound
    • How to make sure the platform is not chrome process CPU bound? In most cases, CPU bound happens in Content process.


  • memcpy peformance
    • System memory to graphic memory copy
    • System memory to system memory copy
  • CPU Scheduling/ Governor
    • Try to lock CPU cores/frequency(platform-dependent)
For example:
adb shell echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
http://androidforums.com/xperia-mini-all-things-root/513426-android-cpu-governors-explained.html
use watch -n 0.3 "adb shell cat file_node_of_CPU_frequency"
For example:
watch -n 0.3 "adb shell cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq"
    • use simple script to see CPU loading and frequency
      • adb shell while true; do i=1; done
    • Gecko profiler[1] to get the callstack of CPU bound
    • Linux perf

Content process profiling

  • Software rendering
    • Lock/unlock graphic buffer cost
    • render cost with cairo or skia
    • sendupdate (layertransaction) cost
  • GL rendering

Chrome process profiling