From ee87cf37095367096c6dd8d2d30a89a5c38b51e0 Mon Sep 17 00:00:00 2001 From: Alexandre Plateau Date: Sat, 12 Oct 2024 10:25:08 +0200 Subject: [PATCH] chore(benchmarks): running benchmarks and adding results to the repo --- tests/benchmarks/README.md | 20 ++++++++++++++++++++ tests/benchmarks/results/5-ee9ff764.csv | 5 +++++ 2 files changed, 25 insertions(+) create mode 100644 tests/benchmarks/README.md create mode 100644 tests/benchmarks/results/5-ee9ff764.csv diff --git a/tests/benchmarks/README.md b/tests/benchmarks/README.md new file mode 100644 index 000000000..52568b31c --- /dev/null +++ b/tests/benchmarks/README.md @@ -0,0 +1,20 @@ +# Benchmarks + +## Running the benchmarks and storing the results + +1. Run for the repository root +2. Make sure the target `arkscript` has been compiled in release mode, as well as `bench` +```bash +result="tests/benchmarks/results/$(set -- tests/benchmarks/results/*.csv; echo $#)-$(git rev-parse --short HEAD).csv" +cmake-build-release/bench \ + --benchmark_min_warmup_time=1 \ + --benchmark_format=csv \ + --benchmark_time_unit=ms \ + --v=0 | grep -Ev "(New parser|Welder)" > $result +``` + +## Generate the comparison + +```bash +python3 tests/benchmarks/compare.py tests/benchmarks/results/*.csv +``` diff --git a/tests/benchmarks/results/5-ee9ff764.csv b/tests/benchmarks/results/5-ee9ff764.csv new file mode 100644 index 000000000..22c636dd0 --- /dev/null +++ b/tests/benchmarks/results/5-ee9ff764.csv @@ -0,0 +1,5 @@ +name,iterations,real_time,cpu_time,time_unit,bytes_per_second,items_per_second,label,error_occurred,error_message +"quicksort",4601,0.150416,0.150228,ms,,,,, +"ackermann/iterations:50",50,59.9067,59.8294,ms,,,,, +"fibonacci/iterations:100",100,6.27221,6.26509,ms,,,,, +"man_or_boy",45605,0.0153367,0.015325,ms,,,,,