Skip to content

Commit

Permalink
chore: Nat.repr microbenchmark (#3888)
Browse files Browse the repository at this point in the history
  • Loading branch information
nomeata authored Apr 17, 2024
1 parent 627a0f3 commit 4f50544
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/bench/nat_repr.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
def main : List String → IO Unit
| [n] => do
let mut s := 0
for i in [0:n.toNat!] do
for j in [:i] do
s := s + j.repr.length
IO.println s
| _ => throw $ IO.userError "give upper bound"
1 change: 1 addition & 0 deletions tests/bench/nat_repr.lean.args
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5000
1 change: 1 addition & 0 deletions tests/bench/nat_repr.lean.expected.out
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
44945605
8 changes: 8 additions & 0 deletions tests/bench/speedcenter.exec.velcom.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,14 @@
run_config:
<<: *time
cmd: lean reduceMatch.lean
- attributes:
description: nat_repr
tags: [fast, suite]
run_config:
<<: *time
cmd: ./nat_repr.lean.out 5000
build_config:
cmd: ./compile.sh nat_repr.lean
- attributes:
description: unionfind
tags: [fast, suite]
Expand Down

0 comments on commit 4f50544

Please sign in to comment.