Skip to content

Commit

Permalink
Add decode benches, update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniPopes committed Sep 21, 2023
1 parent 25d3ca1 commit c0cf039
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 33 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ cpufeatures = "0.2"

[dev-dependencies]
hex = "~0.4.2"
hex-literal = "0.4"
serde = { version = "1.0", features = ["derive"] }
serde_json = { version = "1.0", default-features = false, features = ["alloc"] }

Expand Down
30 changes: 18 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,24 @@ than `libstd` in formatting.
You can run the following benchmarks with `cargo bench` on a nightly compiler.

```log
test encode_const_hex::bench1_32 ... bench: 1 ns/iter (+/- 0)
test encode_const_hex::bench2_128 ... bench: 5 ns/iter (+/- 0)
test encode_const_hex::bench3_4096 ... bench: 204 ns/iter (+/- 9)
test encode_hex::bench1_32 ... bench: 15 ns/iter (+/- 1)
test encode_hex::bench2_128 ... bench: 60 ns/iter (+/- 2)
test encode_hex::bench3_4096 ... bench: 1,703 ns/iter (+/- 50)
test format_const_hex::bench1_32 ... bench: 15 ns/iter (+/- 0)
test format_const_hex::bench2_128 ... bench: 20 ns/iter (+/- 0)
test format_const_hex::bench3_4096 ... bench: 380 ns/iter (+/- 9)
test format_std::bench1_32 ... bench: 470 ns/iter (+/- 4)
test format_std::bench2_128 ... bench: 1,961 ns/iter (+/- 17)
test format_std::bench3_4096 ... bench: 61,688 ns/iter (+/- 1,994)
test decode::const_hex::bench1_32 ... bench: 12 ns/iter (+/- 0)
test decode::const_hex::bench2_128 ... bench: 43 ns/iter (+/- 0)
test decode::const_hex::bench3_4096 ... bench: 1,349 ns/iter (+/- 24)
test decode::hex::bench1_32 ... bench: 50 ns/iter (+/- 1)
test decode::hex::bench2_128 ... bench: 233 ns/iter (+/- 16)
test decode::hex::bench3_4096 ... bench: 7,323 ns/iter (+/- 85)
test encode::const_hex::bench1_32 ... bench: 1 ns/iter (+/- 0)
test encode::const_hex::bench2_128 ... bench: 4 ns/iter (+/- 0)
test encode::const_hex::bench3_4096 ... bench: 138 ns/iter (+/- 0)
test encode::hex::bench1_32 ... bench: 13 ns/iter (+/- 0)
test encode::hex::bench2_128 ... bench: 51 ns/iter (+/- 4)
test encode::hex::bench3_4096 ... bench: 1,593 ns/iter (+/- 13)
test format::const_hex::bench1_32 ... bench: 11 ns/iter (+/- 0)
test format::const_hex::bench2_128 ... bench: 14 ns/iter (+/- 0)
test format::const_hex::bench3_4096 ... bench: 312 ns/iter (+/- 2)
test format::std::bench1_32 ... bench: 462 ns/iter (+/- 1)
test format::std::bench2_128 ... bench: 1,929 ns/iter (+/- 4)
test format::std::bench3_4096 ... bench: 62,233 ns/iter (+/- 523)
```

## Acknowledgements
Expand Down
Loading

0 comments on commit c0cf039

Please sign in to comment.