Skip to content

Commit

Permalink
change import to gleamy/bench
Browse files Browse the repository at this point in the history
  • Loading branch information
schurhammer committed Dec 4, 2023
1 parent ae85678 commit c415008
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Changelog

# v0.3.0 2023.12.05

- Change import structure from `import gleamy_bench` to `import gleamy/bench`
- Increase default benchmark duration to 2000ms, warmup to 500ms.
22 changes: 10 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,18 @@ A library for benchmarking gleam code.
# How To

```rust
import gleamy/bench

...

bench.run(
[
bench.Input("pre-sorted list", list.range(1, 100_000)),
bench.Input("reversed list", list.range(1, 100_000) |> list.reverse),
],
[
bench.Function("list.sort()", sort_int)
],
[
bench.Duration(1000),
bench.Warmup(100)
],
)
[
bench.Input("pre-sorted list", list.range(1, 100_000)),
bench.Input("reversed list", list.reverse(list.range(1, 100_000))),
],
[bench.Function("list.sort()", sort_int)],
[bench.Duration(1000), bench.Warmup(100)],
)
|> bench.table([bench.IPS, bench.Min, bench.P(99)])
|> io.println()

Expand Down
2 changes: 1 addition & 1 deletion gleam.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name = "gleamy_bench"
version = "0.2.0"
version = "0.3.0"

# Fill out these fields if you intend to generate HTML documentation or publish
# your project to the Hex package manager.
Expand Down
File renamed without changes.
8 changes: 2 additions & 6 deletions src/gleamy_bench_example.gleam
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import gleamy_bench as bench
import gleamy/bench
import gleam/io
import gleam/int
import gleam/list
Expand All @@ -11,11 +11,7 @@ pub fn main() {
bench.run(
[
bench.Input("pre-sorted list", list.range(1, 100_000)),
bench.Input(
"reversed list",
list.range(1, 100_000)
|> list.reverse,
),
bench.Input("reversed list", list.reverse(list.range(1, 100_000))),
],
[bench.Function("list.sort()", sort_int)],
[bench.Duration(1000), bench.Warmup(100)],
Expand Down

0 comments on commit c415008

Please sign in to comment.