Skip to content

Commit

Permalink
Merge branch 'master' of github.com:composablesys/wish-you-were-fast
Browse files Browse the repository at this point in the history
  • Loading branch information
titzer committed Feb 28, 2025
2 parents 566c6a3 + b54bafc commit 3541590
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 53 deletions.
68 changes: 15 additions & 53 deletions scripts/compare.bash
Original file line number Diff line number Diff line change
@@ -1,60 +1,22 @@
#!/bin/bash

HERE=$(cd $(dirname ${BASH_SOURCE[0]}) && pwd)
if [ "$#" -lt 3 ]; then
echo "Usage: [RUNS=<n>] compare.bash <command A> <command B> <arguments>"
exit 1
fi

BENCHMARKS="BENCHMARK bicg mvt atax gemver trmm doitgen syrk correlation covariance symm syr2k gemm gramschmidt 2mm nussinov adi 3mm fdtd-2d jacobi-2d seidel-2d heat-3d cholesky ludcmp lu"
CMD_A=$1
shift
CMD_B=$1
shift

ENGINES=${ENGINES:="v8-turbofan v8-liftoff wizeng-jit"}
RUNS=${RUNS:=10}

COLUMN=1
for b in $BENCHMARKS; do
f=~/pbench/$b.wasm
LABEL_A=${LABEL_A:="A"}
LABEL_B=${LABEL_B:="B"}

printf "%s " $b

if [ $COLUMN = 1 ]; then
printf "\twizeng-jit"
else
METRIC=$($HERE/engines/wizeng -mode=jit --metrics=main:time_us $f | grep main:time | awk '{print $3}')
printf "\t%s" $(python <<< "print('%.6f' % ($METRIC/1000000.0))")
fi

if [ $COLUMN = 1 ]; then
printf "\twizeng-jit2"
else
METRIC=$(/tmp/wizeng-untagged -mode=jit --metrics=main:time_us $f | grep main:time | awk '{print $3}')
printf "\t%s" $(python <<< "print('%.6f' % ($METRIC/1000000.0))")
fi

if [ $COLUMN = 1 ]; then
printf "\tv8-liftoff"
else
printf "\t%s" $($HERE/engines/v8-liftoff $f | grep main:time | awk '{print $3}')
fi
printf "%-20s:\t" "$LABEL_A"
btime -i $RUNS $CMD_A $@

if [ $COLUMN = 1 ]; then
printf "\tv8-turbofan"
else
printf "\t%s" $($HERE/engines/v8-turbofan $f | grep main:time | awk '{print $3}')
fi

if [ $COLUMN = 1 ]; then
printf "\twizeng"
else
METRIC=$($HERE/engines/wizeng --metrics=main:time_us $f | grep main:time | awk '{print $3}')
printf "\t%s" $(python <<< "print('%.6f' % ($METRIC/1000000.0))")
fi

printf "\n"

COLUMN=0
done

exit 0
for b in $@; do
echo ---- $b --------
for e in $ENGINES; do
printf " %-12s: " $e
btime 5 $HERE/engines/$e $b
done
done
printf "%-20s:\t" "$LABEL_B"
btime -i $RUNS $CMD_B $@
22 changes: 22 additions & 0 deletions wasm/suites/wasm-r3/sorted.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
ogv
game-of-life
video
figma-startpage
rtexviewer
sqlgui
riconpacker
visual6502remix
handy-tools
boa
guiicons
ffmpeg
jsc
kittygame
commanderkeen
funky-kart
uarm
sandspiel
pathfinding
multiplyInt
heatmap
multiplyDouble

0 comments on commit 3541590

Please sign in to comment.