Added ability to turn off 4 major optimizations, integrated into benchmarks now focused only on Kraken (and NewLisp)

This commit is contained in:
Nathan Braswell
2022-11-10 02:10:56 -05:00
parent a7248daca0
commit 8638086480
7 changed files with 143 additions and 94 deletions

View File

@@ -9,12 +9,12 @@ endif ()
enable_testing()
add_subdirectory(kraken)
add_subdirectory(koka)
add_subdirectory(cpp)
add_subdirectory(haskell)
add_subdirectory(java)
add_subdirectory(ocaml)
add_subdirectory(swift)
#add_subdirectory(koka)
#add_subdirectory(cpp)
#add_subdirectory(haskell)
#add_subdirectory(java)
#add_subdirectory(ocaml)
#add_subdirectory(swift)
add_subdirectory(python)
add_subdirectory(scheme)

View File

@@ -206,7 +206,10 @@
monad (array 'write 1 (str "running tree test") (vau (written code)
(array 'args (vau (args code)
(array 'exit (log (reduce-test-tree (make-test-tree (read-string (idx args 1)) map-empty))))
;(array 'exit (log (reduce-test-tree (make-test-tree (read-string (idx args 1)) map-empty))))
(array 'exit (let (a (log (reduce-test-tree (make-test-tree (read-string (idx args 1)) map-empty)))) 0))
;(array 'exit (log (let (t (make-test-tree (read-string (idx args 1)) map-empty)
; _ (log "swapping to reduce")
; ) (reduce-test-tree t))))

View File

@@ -296,7 +296,8 @@
monad (array 'write 1 (str "running tree test") (vau (written code)
(array 'args (vau (args code)
(array 'exit (log (reduce-test-tree (make-test-tree (read-string (idx args 1)) map-empty))))
;(array 'exit (log (reduce-test-tree (make-test-tree (read-string (idx args 1)) map-empty))))
(array 'exit (let (a (log (reduce-test-tree (make-test-tree (read-string (idx args 1)) map-empty)))) 0))
))
))

View File

@@ -4,20 +4,22 @@ SOURCE="$1"
OUT_DIR="$2"
OUT_NAME="$3"
scheme --script "$OUR_DIR/../partial_eval.scm" $SOURCE
mkdir -p "$OUT_DIR"
mv ./csc_out.wasm "$OUT_DIR/$OUT_NAME.wasm"
printf '#!/usr/bin/env bash\nwasmtime "$(dirname $(readlink -f $0))/'"$OUT_NAME"'.wasm" $@' > "$OUT_DIR/$OUT_NAME"
chmod 755 "$OUT_DIR/$OUT_NAME"
doit() {
TAG=$1
OPTION=$2
scheme --script "$OUR_DIR/../partial_eval.scm" $SOURCE $OPTION
mkdir -p "$OUT_DIR"
mv ./csc_out.wasm "$OUT_DIR/$OUT_NAME$TAG.wasm"
printf '#!/usr/bin/env bash\nwasmtime "$(dirname $(readlink -f $0))/'"$OUT_NAME$TAG"'.wasm" $@' > "$OUT_DIR/$OUT_NAME$TAG"
chmod 755 "$OUT_DIR/$OUT_NAME$TAG"
printf '#!/usr/bin/env bash\nWAVM_OBJECT_CACHE_DIR=$(pwd) wavm run "$(dirname $(readlink -f $0))/'"$OUT_NAME"'.wasm" $@' > "$OUT_DIR/$OUT_NAME-wavm"
chmod 755 "$OUT_DIR/$OUT_NAME-wavm"
printf '#!/usr/bin/env bash\nWAVM_OBJECT_CACHE_DIR=$(pwd) wavm run "$(dirname $(readlink -f $0))/'"$OUT_NAME$TAG"'.wasm" $@' > "$OUT_DIR/$OUT_NAME$TAG-wavm"
chmod 755 "$OUT_DIR/$OUT_NAME$TAG-wavm"
}
scheme --script "$OUR_DIR/../partial_eval.scm" $SOURCE no_compile
mv ./csc_out.wasm "$OUT_DIR/$OUT_NAME-slow.wasm"
#printf '#!/usr/bin/env bash\nwasmtime "$(dirname $(readlink -f $0))/'"$OUT_NAME-slow"'.wasm" $@' > "$OUT_DIR/$OUT_NAME-slow"
#chmod 755 "$OUT_DIR/$OUT_NAME-slow"
printf '#!/usr/bin/env bash\nWAVM_OBJECT_CACHE_DIR=$(pwd) wavm run "$(dirname $(readlink -f $0))/'"$OUT_NAME-slow"'.wasm" $@' > "$OUT_DIR/$OUT_NAME-slow-wavm"
chmod 755 "$OUT_DIR/$OUT_NAME-slow-wavm"
doit "-n" ""
doit -slow no_compile
doit -no_lazy_env no_lazy_env
doit -no_y_comb no_y_comb
doit -no_prim_inline no_prim_inline
doit -no_closure_inline no_closure_inline

View File

@@ -65,10 +65,13 @@ for do_log in [False, True]:
plt.legend()
plt.tight_layout()
plt.xticks(rotation = 45)
#plt.xticks(rotation = 45)
plt.xticks(rotation = 90)
if do_log:
plt.subplots_adjust(left=0.10)
#plt.subplots_adjust(left=0.10)
plt.subplots_adjust(left=0.15)
plt.semilogy()
plt.subplots_adjust(bottom=0.32)
#plt.subplots_adjust(bottom=0.32)
plt.subplots_adjust(bottom=0.65)
plt.savefig(f"{sys.argv[1]}_{'log' if do_log else ''}.png", dpi = 96 * 2 * 2)
#plt.show()

View File

@@ -14,24 +14,30 @@ popd
mkdir -p slow
find build -type f -name \*slow\* -exec mv {} slow \;
cp ./build/kraken/out/bench/kraken-* ./slow
mv ./build/kraken/out/bench/kraken-cfold ./slow
mv ./build/newlisp/out/bench/* ./slow
cp ./slow/newlisp-slow-fexpr-rbtree ./build/newlisp/out/bench/
#cp ./build/kraken/out/bench/kraken-* ./slow
cp ./build/kraken/out/bench/kraken-*-n* ./slow
mv ./build/kraken/out/bench/kraken-cfold-n ./slow
#mv ./build/newlisp/out/bench/* ./slow
nix develop -i -c bash -c 'ulimit -s unlimited && find build -type f -executable -name \*rbtree\* -printf "\"%p 880\"\n" | xargs hyperfine --ignore-failure --warmup 2 --export-markdown rbtree_table.md --export-csv rbtree_table.csv'
#nix develop -i -c bash -c 'ulimit -s unlimited && find build -type f -executable -name \*rbtree\* -printf "\"%p 420000\"\n" | xargs hyperfine --ignore-failure --warmup 2 --export-markdown rbtree_table.md --export-csv rbtree_table.csv'
#nix develop -i -c bash -c 'ulimit -s unlimited && find build -type f -executable -name \*fib\* -printf "\"%p 30\"\n" | xargs hyperfine --ignore-failure --warmup 2 --export-markdown fib_table.md --export-csv fib_table.csv'
nix develop -i -c bash -c 'ulimit -s unlimited && find build -type f -executable -name \*fib\* -printf "\"%p 30\"\n" | xargs hyperfine --ignore-failure --warmup 2 --export-markdown fib_table.md --export-csv fib_table.csv'
nix develop -i -c bash -c 'ulimit -s unlimited && find build -type f -executable -name \*nqueens\* -printf "\"%p 8\"\n" | xargs hyperfine --ignore-failure --warmup 2 --export-markdown nqueens_table.md --export-csv nqueens_table.csv'
#nix develop -i -c bash -c 'ulimit -s unlimited && find build -type f -executable -name \*nqueens\* -printf "\"%p 10\"\n" | xargs hyperfine --ignore-failure --warmup 2 --export-markdown nqueens_table.md --export-csv nqueens_table.csv'
#nix develop -i -c bash -c 'ulimit -s unlimited && find build -type f -executable -name \*deriv\* -printf "\"%p 8\"\n" | xargs hyperfine --ignore-failure --warmup 2 --export-markdown deriv_table.md --export-csv deriv_table.csv'
nix develop -i -c bash -c 'ulimit -s unlimited && find build -type f -executable -name \*deriv\* -printf "\"%p 8\"\n" | xargs hyperfine --ignore-failure --warmup 2 --export-markdown deriv_table.md --export-csv deriv_table.csv'
nix develop -i -c bash -c 'ulimit -s unlimited && find build -type f -executable -name \*cfold\* -printf "\"%p 7\"\n" | xargs hyperfine --ignore-failure --warmup 2 --export-markdown cfold_table.md --export-csv cfold_table.csv'
#nix develop -i -c bash -c 'ulimit -s unlimited && find build -type f -executable -name \*cfold\* -printf "\"%p 20\"\n" | xargs hyperfine --ignore-failure --warmup 2 --export-markdown cfold_table.md --export-csv cfold_table.csv'
#nix develop -i -c bash -c 'ulimit -s unlimited && find slow -type f -executable -name \*nqueens\* -printf "\"%p 7\"\n" | xargs hyperfine --ignore-failure --warmup 2 --export-markdown slow_nqueens_table.md --export-csv slow_nqueens_table.csv'
#nix develop -i -c bash -c 'ulimit -s unlimited && find slow -type f -executable -name \*cfold\* -printf "\"%p 5\"\n" | xargs hyperfine --ignore-failure --warmup 2 --export-markdown slow_cfold_table.md --export-csv slow_cfold_table.csv'
#nix develop -i -c bash -c 'ulimit -s unlimited && find slow -type f -executable -name \*deriv\* -printf "\"%p 3\"\n" | xargs hyperfine --ignore-failure --warmup 2 --export-markdown slow_deriv_table.md --export-csv slow_deriv_table.csv'
#nix develop -i -c bash -c 'ulimit -s unlimited && find slow -type f -executable -name \*rbtree\* -printf "\"%p 100\"\n" | xargs hyperfine --ignore-failure --warmup 2 --export-markdown slow_rbtree_table.md --export-csv slow_rbtree_table.csv'
#nix develop -i -c bash -c 'ulimit -s unlimited && find slow -type f -executable -name \*rbtree\* -printf "\"%p 10\"\n" | xargs hyperfine --ignore-failure --warmup 2 --export-markdown slow_rbtree_table.md --export-csv slow_rbtree_table.csv'
nix develop -i -c bash -c 'ulimit -s unlimited && find slow -type f -executable -name \*rbtree\* -printf "\"%p 100\"\n" | xargs hyperfine --ignore-failure --warmup 2 --export-markdown slow_rbtree_table.md --export-csv slow_rbtree_table.csv'
nix develop -i -c bash -c 'ulimit -s unlimited && find slow -type f -executable -name \*fib\* -printf "\"%p 30\"\n" | xargs hyperfine --ignore-failure --warmup 2 --export-markdown slow_fib_table.md --export-csv slow_fib_table.csv'
nix develop -i -c bash -c 'ulimit -s unlimited && find slow -type f -executable -name \*nqueens\* -printf "\"%p 7\"\n" | xargs hyperfine --ignore-failure --warmup 2 --export-markdown slow_nqueens_table.md --export-csv slow_nqueens_table.csv'
nix develop -i -c bash -c 'ulimit -s unlimited && find slow -type f -executable -name \*deriv\* -printf "\"%p 3\"\n" | xargs hyperfine --ignore-failure --warmup 2 --export-markdown slow_deriv_table.md --export-csv slow_deriv_table.csv'
nix develop -i -c bash -c 'ulimit -s unlimited && find slow -type f -executable -name \*cfold\* -printf "\"%p 5\"\n" | xargs hyperfine --ignore-failure --warmup 2 --export-markdown slow_cfold_table.md --export-csv slow_cfold_table.csv'
#nix develop -i -c bash -c 'ulimit -s unlimited && find slow -type f -executable -name \*fib\* -printf "\"%p 30\"\n" | xargs hyperfine --ignore-failure --warmup 2 --export-markdown slow_fib_table.md --export-csv slow_fib_table.csv'
#nix develop -i -c bash -c 'ulimit -s unlimited && hyperfine --ignore-failure --warmup 2 --export-markdown slow_ish_rbtree_table.md --export-csv slow_ish_rbtree_table.csv "./slow/kraken-rbtree-opt 890" "./slow/kraken-rbtree-opt-wavm 890" "./slow/newlisp-slow-fexpr-rbtree 890" "./slow/newlisp-macro-rbtree 890"'
#nix develop -i -c bash -c 'ulimit -s unlimited && hyperfine --ignore-failure --warmup 2 --export-markdown slow_rbtree_table.md --export-csv slow_rbtree_table.csv "./slow/kraken-rbtree-opt 100" "./slow/kraken-rbtree-opt-wavm 100" "./slow/newlisp-slow-fexpr-rbtree 100" "./slow/newlisp-macro-rbtree 100" "./slow/kraken-rbtree-slow-wavm 100"'
@@ -47,3 +53,5 @@ do
cat "$x" >> benchmarks.md
printf "\n\n\n" >> benchmarks.md
done
cp *.png ~/school/vau_partial_eval_paper/images/
cp *.cssv ~/school/vau_partial_eval_paper/