tree-sitter/script/benchmark

38 lines
565 B
Text
Raw Normal View History

#!/usr/bin/env bash
set -e
2017-07-05 17:27:32 -07:00
function usage {
cat <<-EOF
USAGE
$0 [-h] [-l language-name] [-e example-file-name]
2017-07-05 17:27:32 -07:00
OPTIONS
-h print this message
-l run only the benchmarks for the given language
-e run only the benchmarks that parse the example file with the given name
2017-07-06 10:22:14 -07:00
2017-07-05 17:27:32 -07:00
EOF
}
while getopts "hl:e:" option; do
case ${option} in
2017-07-05 17:27:32 -07:00
h)
usage
exit
;;
e)
export TREE_SITTER_BENCHMARK_EXAMPLE_FILTER=${OPTARG}
;;
l)
export TREE_SITTER_BENCHMARK_LANGUAGE_FILTER=${OPTARG}
2017-07-06 10:22:14 -07:00
;;
esac
done
cargo bench