diff options
Diffstat (limited to '')
| -rwxr-xr-x | benchmarks/run-egg-benchmarks.sh | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/benchmarks/run-egg-benchmarks.sh b/benchmarks/run-egg-benchmarks.sh new file mode 100755 index 0000000..d29db27 --- /dev/null +++ b/benchmarks/run-egg-benchmarks.sh | |||
| @@ -0,0 +1,40 @@ | |||
| 1 | scr="../nissy-core/benchmarks/scrambles" | ||
| 2 | out="../nissy-core/benchmarks/results_egg.py" | ||
| 3 | |||
| 4 | get_solve_time() { | ||
| 5 | ./target/release/solve -t "$1" --table "tables/h$2" <"$3" \ | ||
| 6 | | tail -1 | sed 's/.*cubes wall //; s/ wall.*//' | ||
| 7 | } | ||
| 8 | |||
| 9 | do_all() { | ||
| 10 | echo "doing all $1 $2" | ||
| 11 | t=$1 | ||
| 12 | name=$2 | ||
| 13 | printf '%s = {\n' "$name" >> "$out" | ||
| 14 | for i in 6 7 8 9 10 11 ; do | ||
| 15 | echo "Doing 17 moves for h$i with $t threads..." | ||
| 16 | t17="$(get_solve_time $t $i "$scr/scrambles-17.txt")" | ||
| 17 | echo "Doing 18 moves for h$i with $t threads..." | ||
| 18 | t18="$(get_solve_time $t $i "$scr/scrambles-18.txt")" | ||
| 19 | echo "Doing 19 moves for h$i with $t threads..." | ||
| 20 | t19="$(get_solve_time $t $i "$scr/scrambles-19.txt")" | ||
| 21 | printf '\t%s: {17: %s, 18: %s, 19: %s' $i $t17 $t18 $t19 >> "$out" | ||
| 22 | if [ "$i" -ge 10 ]; then | ||
| 23 | echo "Doing 20 moves for h$i with $t threads..." | ||
| 24 | t20="$(get_solve_time $t $i "$scr/scrambles-20.txt")" | ||
| 25 | printf ', 20: %s' $t20 >> "$out" | ||
| 26 | echo "Doing superflip moves for h$i with $t threads..." | ||
| 27 | tsf="$(get_solve_time $t $i "$scr/superflip.txt")" | ||
| 28 | printf ', "superflip": %s},\n' $tsf >> "$out" | ||
| 29 | else | ||
| 30 | printf '},\n' >> "$out" | ||
| 31 | fi | ||
| 32 | done | ||
| 33 | printf '}\n\n' >> "$out" | ||
| 34 | } | ||
| 35 | |||
| 36 | printf '' > "$out" | ||
| 37 | |||
| 38 | do_all 1 "egg_single_thread" | ||
| 39 | do_all 4 "egg_4_threads" | ||
| 40 | do_all 16 "egg_16_threads" | ||
