From 9299c4ef655b88eb8b571864c939c78b27f77723 Mon Sep 17 00:00:00 2001 From: mhsn Date: Fri, 12 Sep 2025 20:20:30 +0100 Subject: merge bench into check --- bench | 50 -------------------------------------------------- 1 file changed, 50 deletions(-) delete mode 100755 bench (limited to 'bench') diff --git a/bench b/bench deleted file mode 100755 index 8cdc95d..0000000 --- a/bench +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env sh - -usage="usage: bench []" -year=${1?$usage} -day=${2?$usage} -lang=${3?$usage} -input=${4?$usage} -warmups=${5:-0} - -# get directory of this script -script=$(readlink -f "$0") -script_path=$(dirname "$script") - -# find aoc and data paths -aoc_path=$script_path/$year/$day -data_path="$aoc_path/data/$input.txt" - -# check solution is correct for this input -$script_path/check $year $day $lang $input >/dev/null -[ ! $? ] && echo "incorrect solution" && exit 1 - -case $lang in -"python") - # Sync to create venv - uv sync \ - --directory \ - $aoc_path/python - # Bypass any `uv run` overhead and run .venv directly - exec="$aoc_path/python/.venv/bin/python $aoc_path/python/main.py" - ;; -"rust") - # Compile to /tmp/aoc_rust and run binary - cargo build \ - --release \ - --target-dir /tmp/aoc_rust \ - --manifest-path \ - $aoc_path/rust/Cargo.toml - exec="/tmp/aoc_rust/release/aoc_$year-$day" - ;; -*) - echo "unknown lang: $lang" - exit 1 - ;; -esac - -hyperfine \ - --shell none \ - --warmup $warmups \ - --input $data_path \ - "$exec" -- cgit v1.2.3