Skip to content

Instantly share code, notes, and snippets.

@timsutton
Last active December 6, 2023 14:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timsutton/7b287141540b1f4606eab7a6b5c6c63d to your computer and use it in GitHub Desktop.
Save timsutton/7b287141540b1f4606eab7a6b5c6c63d to your computer and use it in GitHub Desktop.
Example benchmark of bazel building envoy using hyperfine.sh
#!/bin/bash
#
# Example of using hyperfine to benchmark bazel-based builds of Envoy proxy:
# https://github.com/envoyproxy/envoy/
target="//source/exe:envoy_main_common_lib"
# Other examples of targets:
# main binary
# target="//source/exe:envoy-static"
# a smaller target:
# target="//source/common/ssl/matching:all"
# benchmarking b58d312729
hyperfine \
--min-runs 3 \
--setup "bazel fetch ${target}" \
--prepare "bazel clean" \
"bazel build ${target}"
# Results from my M3 Max:
# Benchmark 1: bazel build //source/exe:envoy_main_common_lib
# Time (mean ± σ): 868.778 s ± 14.420 s [User: 0.067 s, System: 0.076 s]
# Range (min … max): 854.784 s … 883.589 s 3 runs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment