Skip to content

Commit

Permalink
Use tasty for benchmarking.
Browse files Browse the repository at this point in the history
  • Loading branch information
alaendle committed Nov 3, 2023
1 parent 9ebc22f commit 557d9a6
Show file tree
Hide file tree
Showing 6 changed files with 225 additions and 155 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macOS-latest]
cabal: ["3.6"]
cabal: ["3.10"]
ghc:
- "8.10.7"
- "9.6.3"

steps:
- uses: actions/checkout@v4
Expand Down
23 changes: 3 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,29 +67,12 @@ library.
To run benchmarks, use the following command:

```
cabal v2-run co-log-bench
cabal v2-run co-log-bench -- --svg bench.svg &> /dev/null
```

| Benchmarks | Time for 10K messages |
| :------------------------------------------------------ | :-------------------- |
| `Prelude.putStrLn` | ` 5.117ms` |
| `Text.putStrLn` | ` 9.220ms` |
| `ByteString.putStrLn` | ` 2.971ms` |
| `mempty` | ` 1.181ms` |
| `logStringStdout` | ` 5.107ms` |
| `logPrint` | ` 5.248ms` |
| `logTextStdout` | ` 5.351ms` |
| `logByteStringStdout` | ` 2.933ms` |
| `logByteStringStderr` | ` 17.482ms` |
| `ByteString > (stdout <> stderr)` | ` 17.715ms` |
| `Message > format > stdout` | ` 9.188ms` |
| `Message > format > ByteString > stdout` | ` 3.524ms` |
| `Message{callstack} > format > stdout` | ` 9.139ms` |
| `Message{callstack:5} > format > stdout` | ` 9.464ms` |
| `Message{callstack:50} > format > stdout` | ` 9.439ms` |
| `Message{Time,ThreadId} > format > stdout` | ` 54.160ms` |
| `Message{Time,ThreadId} > format > ByteString > stdout` | ` 54.137ms` |
**Time for 10K messages:**

![Benchmarks](bench.svg)

[hk-img]: https://img.shields.io/hackage/v/co-log.svg?logo=haskell
[hk-img-ps]: https://img.shields.io/hackage/v/co-log-polysemy.svg?logo=haskell
Expand Down
181 changes: 181 additions & 0 deletions bench.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 557d9a6

Please sign in to comment.