lean4-htt/tests/playground/perf.lean
Leonardo de Moura 1716f1f6c9 test(tests/playground/perf): performance test
On my macbook,
- with default kind STHeap: 3.15 secs
- with default kind MTHeap: 3.75 secs

@cc kha
2019-02-14 08:43:04 -08:00

15 lines
295 B
Text

def g (a : nat) (n : nat) : list nat :=
let xs := list.repeat a n in
xs.map (+2)
def h (xs : list nat) : nat :=
xs.foldl (+) 0
def rep (n : nat) : nat :=
n.repeat (λ i r, h (g i n)) 0
def act (n : nat) : io unit :=
io.println' (to_string (rep n))
def main : io uint32 :=
act 5000 *> pure 0