TPEPlatform/Graphic

From MozillaWiki
Jump to: navigation, 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.
    • Enable COMPOSITOR_PERFORMANCE_WARNING option defined in CompositorParent.h. It will print out warning message if layers' transaction or composition time(Chrome process) is too long(the threshold is 15ms now).
      • Note that the composition time here contains both "composite scheduling" and "layers' composing". And the "layers' composing" is executed by GPU if HWComposer is not enabled.
For example:
   "adb shell logcat" may print out the two messages.
   if composition time is too long => "Compositor: Composite took 20 ms."
   if transaction time is too long => "Compositor: Layers update took 22 ms (blocking gecko)."
  • memcpy peformance
    • System memory to graphic memory copy
    • System memory to system memory copy
  • CPU Scheduler/ CPU Governor
    • Lock CPU cores and 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

bug 908033 - [META] Render profiler suite