Skip to content

Commit

Permalink
improve benchmarks and reduce noise by making them longer
Browse files Browse the repository at this point in the history
  • Loading branch information
zapashcanon committed Oct 17, 2024
1 parent e4c75df commit 8950f25
Show file tree
Hide file tree
Showing 13 changed files with 278 additions and 272 deletions.
13 changes: 4 additions & 9 deletions wasm/test/bdd.ml
Original file line number Diff line number Diff line change
Expand Up @@ -243,21 +243,16 @@ let test_hwb bdd vars =
eval bdd vars = if !ntrue > 0 then vars.(!ntrue - 1) else false

let main () =
let n = 22 in
let n = 25 in
let ntests = 100 in
let bdd = hwb n in
let succeeded = ref true in
for _ = 1 to ntests do
succeeded := !succeeded && test_hwb bdd (random_vars n)
done;
assert !succeeded

(*
assert !succeeded;
if !succeeded
then print_string "OK\n"
else print_string "FAILED\n";
Format.eprintf "%d@." !nodeC;
exit 0
*)
else print_string "FAILED\n"

let _ = main ()
let () = main ()
1 change: 0 additions & 1 deletion wasm/test/boyer.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1206,7 +1206,6 @@ let _ =
print_string "Proved!\n"
else
print_string "Cannot prove!\n";
exit 0
*)

(*********
Expand Down
1 change: 0 additions & 1 deletion wasm/test/boyer_no_exc.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1215,7 +1215,6 @@ let _ =
print_string "Proved!\n"
else
print_string "Cannot prove!\n";
exit 0
*)

(*********
Expand Down
36 changes: 17 additions & 19 deletions wasm/test/fannkuch2.ml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
contributed by Isaac Gouy, transliterated from Mike Pall's Lua program
*)

exception Done

let fannkuch n =
let p = Array.make n 0 in
let q = Array.make n 0 in
Expand Down Expand Up @@ -36,19 +38,19 @@ let fannkuch n =
let qq = q.(!q0) in
q.(!q0) <- !q0;
(if !q0 >= 3
then
let i = ref 1 in
let j = ref (!q0 - 1) in
while
let t = q.(!i) in
q.(!i) <- q.(!j);
q.(!j) <- t;
incr i;
decr j;
!i < !j
do
()
done);
then
let i = ref 1 in
let j = ref (!q0 - 1) in
while
let t = q.(!i) in
q.(!i) <- q.(!j);
q.(!j) <- t;
incr i;
decr j;
!i < !j
do
()
done);
q0 := qq;
incr flips
done);
Expand All @@ -73,7 +75,7 @@ let fannkuch n =
if i = n - 1
then (
if false then Format.eprintf "%d %d@." !sum !maxflips;
exit 0);
raise Done);
s.(i) <- i;
let t = p.(0) in
for j = 0 to i do
Expand All @@ -86,8 +88,4 @@ let fannkuch n =

let n = 10

let pf = fannkuch n

(*
//print(pf[0] + "\n" + "Pfannkuchen(" + n + ") = " + pf[1]);
*)
let () = try fannkuch n with Done -> ()
14 changes: 3 additions & 11 deletions wasm/test/fib.ml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,6 @@ let rec fib n =
else fib (n - 1) + fib (n - 2)

let () =
let n = 40 in
assert (fib n = 102334155)
(*
for i = 0 to 40 do
print_string "fib (";
print_int i;
print_string ") = ";
print_int (fib i);
print_string "\n"
done
*)
let n = 43 in
let res = fib n in
print_int res
4 changes: 2 additions & 2 deletions wasm/test/kb.ml
Original file line number Diff line number Diff line change
Expand Up @@ -584,5 +584,5 @@ let group_order = rpo group_precedence lex_ext
let greater pair =
match group_order pair with Greater -> true | _ -> false

let _ =
for i = 1 to 20 do kb_complete greater [] geom_rules done
let () =
for i = 1 to 55 do kb_complete greater [] geom_rules done
Loading

0 comments on commit 8950f25

Please sign in to comment.