Skip to content

Commit

Permalink
add benchmarking harness
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianHicks committed Nov 18, 2020
1 parent 4d863fe commit aae3699
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
15 changes: 15 additions & 0 deletions script/bench.sh
@@ -0,0 +1,15 @@
#!/usr/bin/env bash
set -xeuo pipefail

cargo build --release

mkdir -p bench_config
trap 'rm -r bench_config' EXIT

./target/release/elm-forbid-import -c bench_config/config.toml add-root vendor/elm-spa-example
./target/release/elm-forbid-import -c bench_config/config.toml forbid Html --hint "Use Html.Styled"
./target/release/elm-forbid-import -c bench_config/config.toml forbid Html.Events
./target/release/elm-forbid-import -c bench_config/config.toml forbid Html.Attributes
./target/release/elm-forbid-import -c bench_config/config.toml update

hyperfine './target/release/elm-forbid-import -c bench_config/config.toml check'
3 changes: 3 additions & 0 deletions shell.nix
Expand Up @@ -16,5 +16,8 @@ stdenv.mkDerivation {
rustPackages.clippy
rustPackages.rustfmt
rustc

# Benchmarking + Optimization
hyperfine
];
}

0 comments on commit aae3699

Please sign in to comment.