From e61c0364dfd877ec0940297231f3dfcb90e30a58 Mon Sep 17 00:00:00 2001 From: crc Date: Fri, 18 Dec 2020 20:18:13 +0000 Subject: [PATCH] benchmarks: add a simple `choose` benchmark (#26) FossilOrigin-Name: a0cac831c406f978982a1a9af3eebe038c04be485e1c72ed834f3538b4def8d5 --- benchmarks/choose.retro | 6 ++++++ benchmarks/nga-c.sh | 1 + benchmarks/nga-python.sh | 2 ++ 3 files changed, 9 insertions(+) create mode 100644 benchmarks/choose.retro diff --git a/benchmarks/choose.retro b/benchmarks/choose.retro new file mode 100644 index 0000000..e6b275c --- /dev/null +++ b/benchmarks/choose.retro @@ -0,0 +1,6 @@ +~~~ +'1,000,000_iterations_of_choose s:put nl +#1000 [ #500 [ FALSE [ ] [ ] choose ] times ] times +#1000 [ #500 [ TRUE [ ] [ ] choose ] times ] times +~~~ + diff --git a/benchmarks/nga-c.sh b/benchmarks/nga-c.sh index 41e4e1a..a45a7c2 100755 --- a/benchmarks/nga-c.sh +++ b/benchmarks/nga-c.sh @@ -2,3 +2,4 @@ time retro times.retro time retro push-drop.retro +time retro choose.retro diff --git a/benchmarks/nga-python.sh b/benchmarks/nga-python.sh index 4f93d8a..d2b9bce 100755 --- a/benchmarks/nga-python.sh +++ b/benchmarks/nga-python.sh @@ -8,9 +8,11 @@ cp ../ngaImage . echo Python3 time python3 retro.py times.retro time python3 retro.py push-drop.retro +time python3 retro.py choose.retro echo PyPy time pypy retro.py times.retro time pypy retro.py push-drop.retro +time pypy retro.py choose.retro rm -f retro.py ngaImage