tree: 8053019d46781ea816efba72071794d07e9fe24f [path history] [tgz]
  1. Android.bp
  2. buffer_benchmarks.cc
  3. buffer_benchmarks.rs
  4. README.md
libs/nativewindow/tests/benchmark/README.md

libnativewindow Benchmarks

This directory contains benchmarks for the C++ and Rust variants of libnativewindow.

Running

It is currently a little tricky to get statistics from Rust benchmarks directly from tradefed. But we can hack it by using atest to build/push, then running the benchmarks by hand to get stats.

  $ atest nativewindow_buffer_benchmarks_rs nativewindow_buffer_benchmarks_cc -d
  $ adb shell /data/local/tmp/nativewindow_buffer_benchmarks_cc/x86_64/nativewindow_buffer_benchmarks_cc
  $ adb shell /data/local/tmp/nativewindow_buffer_benchmarks_rs/x86_64/nativewindow_buffer_benchmarks_rs --bench

Results

On a remote emulator, the results we see from the benchmarks from Rust and C++ seem to be roughly equivalent! Allocating/deallocating a 720p buffer takes ~2.3ms on each.