Files
frameworks_base/core/tests/benchmarks
Jeff Sharkey 3fc37deca8 Benchmarks for streams.
We've been advocating as little usage of streams as possible inside
the system_server, and this is a benchmark showing the costs of using
streams compared to rolling manual logic.

Results on a taimen show that direct route is 2.2x faster (!).

    Trial Report (1 of 2):
      Experiment {instrument=runtime, benchmarkMethod=timeDirect, vm=app_process, parameters={}}
      Results:
        runtime(ns): min=47234.28, 1st qu.=47234.28, median=47234.28, mean=47234.28, 3rd qu.=47234.28, max=47234.28
    Trial Report (2 of 2):
      Experiment {instrument=runtime, benchmarkMethod=timeStreams, vm=app_process, parameters={}}
      Results:
        runtime(ns): min=105660.39, 1st qu.=105660.39, median=105660.39, mean=105660.39, 3rd qu.=105660.39, max=105660.39

Bug: 77808546
Test: vogar --mode app_process --benchmark frameworks/base/core/tests/benchmarks/src/android/util/StreamsBenchmark.java
Change-Id: Iac43a75970eee2c91593316a1b5a45d2c96c476b
2018-04-12 10:43:22 -06:00
..
2018-04-12 10:43:22 -06:00

These benchmarks use the Caliper benchmark framework, and can be
run on a remote device using Vogar:

http://code.google.com/p/caliper/
http://code.google.com/p/vogar/

-------------------------

Quick Command Line Reference:

# Build vogar and dependencies.
$> mmma -j32 external/vogar

# First make sure art has permissions to dalvik-cache, otherwise it will run slower with interpreter.
$> adb root

# Run vogar in benchmark mode, telling it to use app_process (not dalvikvm which is default)
# Otherwise you will likely crash with UnsatisfiedLinkError despite having correct JNI code.

$> vogar --mode app_process --benchmark path/to/Benchmark.java

# Sometimes your benchmarks might time out, if so increase the timeout:
# (--timeout goes to vogar, and --time-limit goes to caliper)
$> vogar --timeout 1000 --mode app_process --benchmark path/to/Benchmark -- --time-limit 9999s