From 5306d1af8f81ebf6ce8bc248b3873d6e00d34ff9 Mon Sep 17 00:00:00 2001
From: charguer <arthur@chargueraud.org>
Date: Tue, 11 Apr 2023 21:34:37 +0200
Subject: [PATCH] yet more benchmarks

---
 benchmark/make.sh           | 34 ++++++++++++++++++++++++++++++++++
 benchmark/src/listk/Main.ml |  4 ----
 2 files changed, 34 insertions(+), 4 deletions(-)

diff --git a/benchmark/make.sh b/benchmark/make.sh
index c15726c..24fbce5 100755
--- a/benchmark/make.sh
+++ b/benchmark/make.sh
@@ -933,6 +933,40 @@ plot_initm_map_iter () {
     -output $graphics
 }
 
+
+# ------------------
+
+run_pushm_iter_simple () {
+  benchmark=listk
+  make src/$benchmark
+  run_prologue
+  result="pushm_iter_simple.out"
+  export OCAMLRUNPARAM=l=8000
+  prun -prog $prog \
+    -scenario pushm_iter \
+    -n $TWO_EXP_25 \
+    -length 16,32,64,256,$TWO_EXP_10,$TWO_EXP_15,$TWO_EXP_18,$TWO_EXP_20,$TWO_EXP_22,$TWO_EXP_24 \
+    -k 1,2 \
+    -output $result \
+    -runs 3
+}
+
+plot_pushm_iter_simple () {
+  #result="$1"
+  # graphics="$2"
+  result="pushm_iter_simple.out"
+  graphics="pushm_iter_simple.pdf"
+  series="$3"
+  echo $graphics > $home/.graphics
+  pplot scatter \
+    --yzero --xlog -x length -y exectime \
+    -legend-pos topleft \
+    -series ${series}k \
+    -input $result \
+    -output $graphics
+}
+
+
 # ------------------
 
 run_pushm_iter () {
diff --git a/benchmark/src/listk/Main.ml b/benchmark/src/listk/Main.ml
index 401d6af..ecde20b 100644
--- a/benchmark/src/listk/Main.ml
+++ b/benchmark/src/listk/Main.ml
@@ -273,20 +273,17 @@ let list1_ref_push s x0 =
 
 let list2_ref_push s x0 =
   s := match !s with
-  | Nil -> Cons1(x0,Nil)
   | Cons1(x1,t) -> Cons2(x0,x1,t)
   | _ as t -> Cons1(x0,t)
 
 let list4_ref_push s x0 =
   s := match !s with
-  | Nil -> Cons1(x0,Nil)
   | Cons1(x1,Cons2(x2,x3,t)) -> Cons4(x0,x1,x2,x3,t)
   | Cons1(x1,t) -> Cons2(x0,x1,t)
   | _ as t -> Cons1(x0,t)
 
 let list8_ref_push s x0 =
   s := match !s with
-  | Nil -> Cons1(x0,Nil)
   | Cons1(x1,Cons2(x2,x3,Cons4(x4,x5,x6,x7,t))) -> Cons8(x0,x1,x2,x3,x4,x5,x6,x7,t)
   | Cons1(x1,Cons2(x2,x3,t)) -> Cons4(x0,x1,x2,x3,t)
   | Cons1(x1,t) -> Cons2(x0,x1,t)
@@ -294,7 +291,6 @@ let list8_ref_push s x0 =
 
 let list16_ref_push s x0 =
   s := match !s with
-  | Nil -> Cons1(x0,Nil)
   | Cons1(x1,Cons2(x2,x3,Cons4(x4,x5,x6,x7,
      Cons8(x8,x9,x10,x11,x12,x13,x14,x15,t)))) ->
       Cons16(x0,x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15,t)
-- 
GitLab