chore(tests/bench): parameterize all benchmarks
This commit is contained in:
parent
4ac235212a
commit
94b3de0130
4 changed files with 23 additions and 13 deletions
|
|
@ -103,6 +103,10 @@ bench/frontend.%.bench: BENCH_PARAMS = --new-frontend frontend_test.lean
|
|||
|
||||
bench/binarytrees.%.bench: BENCH_PARAMS = 21
|
||||
|
||||
bench/deriv.%.bench: BENCH_PARAMS = 10
|
||||
|
||||
bench/const_fold.%.bench: BENCH_PARAMS = 23
|
||||
|
||||
bench/qsort.%.bench: BENCH_PARAMS = 400
|
||||
|
||||
bench/rbmap.%.bench: BENCH_PARAMS = 2000000
|
||||
|
|
|
|||
|
|
@ -65,9 +65,12 @@ def eval : Expr → Nat
|
|||
| Add l r => eval l + eval r
|
||||
| Mul l r => eval l * eval r
|
||||
|
||||
def main : IO UInt32 :=
|
||||
let e := (mkExpr 23 1);
|
||||
let v₁ := eval e;
|
||||
let v₂ := eval (constFolding (reassoc e));
|
||||
IO.println (toString v₁ ++ " " ++ toString v₂) *>
|
||||
pure 0
|
||||
unsafe def main : List String → IO UInt32
|
||||
| [s] => do
|
||||
let n := s.toNat;
|
||||
let e := (mkExpr n 1);
|
||||
let v₁ := eval e;
|
||||
let v₂ := eval (constFolding (reassoc e));
|
||||
IO.println (toString v₁ ++ " " ++ toString v₂);
|
||||
pure 0
|
||||
| _ => pure 1
|
||||
|
|
|
|||
|
|
@ -89,8 +89,11 @@ do
|
|||
IO.println (toString (i+1) ++ " count: " ++ (toString $ count d));
|
||||
pure d
|
||||
|
||||
def main (xs : List String) : IO UInt32 :=
|
||||
do let x := Var "x";
|
||||
let f := pow x x;
|
||||
nest deriv 10 f;
|
||||
pure 0
|
||||
unsafe def main : List String → IO UInt32
|
||||
| [s] => do
|
||||
let n := s.toNat;
|
||||
let x := Var "x";
|
||||
let f := pow x x;
|
||||
nest deriv n f;
|
||||
pure 0
|
||||
| _ => pure 1
|
||||
|
|
|
|||
|
|
@ -48,13 +48,13 @@
|
|||
<<: *time
|
||||
cmd: ./deriv.lean.out
|
||||
build_config:
|
||||
cmd: ./compile.sh deriv.lean
|
||||
cmd: ./compile.sh deriv.lean 10
|
||||
- attributes:
|
||||
description: const_fold
|
||||
tags: [fast, suite]
|
||||
run_config:
|
||||
<<: *time
|
||||
cmd: bash -c "ulimit -s unlimited && ./const_fold.lean.out"
|
||||
cmd: bash -c "ulimit -s unlimited && ./const_fold.lean.out 23"
|
||||
build_config:
|
||||
cmd: ./compile.sh const_fold.lean
|
||||
- attributes:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue