From ae29a22d552286d8a483c4aa03791dd8c2ae1e68 Mon Sep 17 00:00:00 2001 From: Alessio Quaglino Date: Fri, 11 Nov 2022 04:25:47 -0800 Subject: [PATCH] Add flag benchmark. PiperOrigin-RevId: 487788256 Change-Id: Iefab760cafc0123368e5bcd4ec4a579b170f1aba --- test/benchmark/parse_benchmark_test.cc | 5 +++++ test/benchmark/step_benchmark_test.cc | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/test/benchmark/parse_benchmark_test.cc b/test/benchmark/parse_benchmark_test.cc index 9343cd10..9cf9ad27 100644 --- a/test/benchmark/parse_benchmark_test.cc +++ b/test/benchmark/parse_benchmark_test.cc @@ -54,6 +54,11 @@ void ABSL_ATTRIBUTE_NO_TAIL_CALL BM_ParseCloth(benchmark::State& state) { } BENCHMARK(BM_ParseCloth); +void ABSL_ATTRIBUTE_NO_TAIL_CALL BM_ParseFlag(benchmark::State& state) { + run_parse_benchmark("flag/flag.xml", state); +} +BENCHMARK(BM_ParseFlag); + void ABSL_ATTRIBUTE_NO_TAIL_CALL BM_ParseHumanoid(benchmark::State& state) { run_parse_benchmark("humanoid/humanoid.xml", state); } diff --git a/test/benchmark/step_benchmark_test.cc b/test/benchmark/step_benchmark_test.cc index c4704603..860fabf1 100644 --- a/test/benchmark/step_benchmark_test.cc +++ b/test/benchmark/step_benchmark_test.cc @@ -82,6 +82,13 @@ void ABSL_ATTRIBUTE_NO_TAIL_CALL BM_StepCloth(benchmark::State& state) { } BENCHMARK(BM_StepCloth); +void ABSL_ATTRIBUTE_NO_TAIL_CALL BM_StepFlag(benchmark::State& state) { + MujocoErrorTestGuard guard; + static mjModel* model = LoadModelFromPath("flag/flag.xml"); + run_step_benchmark(model, state); +} +BENCHMARK(BM_StepFlag); + void ABSL_ATTRIBUTE_NO_TAIL_CALL BM_StepHumanoid(benchmark::State& state) { MujocoErrorTestGuard guard; static mjModel* model = LoadModelFromPath("humanoid/humanoid.xml");