diff --git a/app/benchmark.gradle b/app/benchmark.gradle index 001951d7e..98dd906b7 100644 --- a/app/benchmark.gradle +++ b/app/benchmark.gradle @@ -53,16 +53,15 @@ ext.maybeConfigForJetpackBenchmark = { android -> // WARNING: the benchmark framework warns you if you're running the test in a configuration // that will compromise the accuracy of the results. Unfortunately, I couldn't get everything // working so I had to suppress some things. - // - // - ACTIVITY-MISSING: we're supposed to use the test instrumentation runner, - // "androidx.benchmark.junit4.AndroidBenchmarkRunner". However, when I do so, I get an error - // that we're unable to launch the activity. My understanding is that this runner will use an - // "IsolationActivity" to reduce the impact of other work on the device from affecting the benchmark - // and to opt into a lower-max CPU frequency on unrooted devices that support it - // - UNLOCKED: ./gradlew lockClocks, which locks the CPU frequency, fails on my device. See - // https://issuetracker.google.com/issues/176836267 for potential workarounds. - testInstrumentationRunnerArguments = [ + + // - ACTIVITY-MISSING: we're supposed to use the test instrumentation runner, + // "androidx.benchmark.junit4.AndroidBenchmarkRunner". However, when I do so, I get an error + // that we're unable to launch the activity. My understanding is that this runner will use an + // "IsolationActivity" to reduce the impact of other work on the device from affecting the benchmark + // and to opt into a lower-max CPU frequency on unrooted devices that support it + // - UNLOCKED: ./gradlew lockClocks, which locks the CPU frequency, fails on my device. See + // https://issuetracker.google.com/issues/176836267 for potential workarounds. 'androidx.benchmark.suppressErrors' : 'ACTIVITY-MISSING,UNLOCKED', // The tests don't always output a JSON file with the data. To make sure it does, we have to @@ -72,10 +71,10 @@ ext.maybeConfigForJetpackBenchmark = { android -> // We set the the output directory simply for simplicity since the benchmark_runner.py script // can't know the name of the phone in the /build/outputs/ directory. The system defaults to // {phone_name} which can be troublesome finding in some case. - - //NOTE: Jetpack Benchmark outputs to Logcat too. However, the output in the logcat is - //the min of the several repeats, for more statistics. Therefore, to get more stats, - //we refer to the JSON file. + // + // NOTE: Jetpack Benchmark outputs to Logcat too. However, the output in the logcat is + // the min of the several repeats, for more statistics. Therefore, to get more stats, + // we refer to the JSON file. additionalTestOutputDir : '/storage/emulated/0/benchmark' ] } diff --git a/tools/run_benchmark.py b/tools/run_benchmark.py index 0456b8982..2086546e8 100644 --- a/tools/run_benchmark.py +++ b/tools/run_benchmark.py @@ -37,9 +37,9 @@ def run_benchmark(class_to_test): def fetch_benchmark_results(): subprocess.run( ['adb', 'pull', "{path}{file}".format(path=output_path, file=output_file)], - cwd=target_directory,check=True, text=True) - print("The benchmark results can be seen here: {file_path}" - .format(file_path=os.path.abspath("./{file}".format(file=file_url)))) + cwd=target_directory, check=True, text=True) + print("The benchmark results can be seen here: {file_path}".format( + file_path=os.path.abspath("./{file}".format(file=file_url)))) def open_in_browser():