tiny perceus fix, but mostly wrote match+rb-tree f-expr/macro for newLisp and benchmarked it. kraken 5-15x faster than newlisp-rbtree-macro, 137x faster than newlisp-rbtree-fexpr. I was suprised at first that the macro and fexpr versions were so close at 8.7x (while interpreted kraken rbtree is 50,000x slower), but after thinking about it it makes sense - the Kraken version has slowdown exponential in the multiple levels of f-exprs ('match' is an fexpr, but then so is 'let' and 'and' and 'lambda'), whereas the newLisp f-expr runtime expands to fast builtins ('let', 'and', etc). And all that exponential f-expr slowdown gets compiled away in Kraken!

This commit is contained in:
Nathan Braswell
2022-07-06 02:34:48 -04:00
parent 2cdfa4dbed
commit e95feb9309
7 changed files with 235 additions and 18 deletions

View File

@@ -16,8 +16,8 @@ chmod 755 "$OUT_DIR/$OUT_NAME-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\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"