Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kixunil/hex_bench
Benchmarks of various Rust hex encoding implemnetations
https://github.com/kixunil/hex_bench
Last synced: about 2 months ago
JSON representation
Benchmarks of various Rust hex encoding implemnetations
- Host: GitHub
- URL: https://github.com/kixunil/hex_bench
- Owner: Kixunil
- Created: 2022-08-31T07:10:48.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-11-01T11:23:06.000Z (about 2 years ago)
- Last Synced: 2024-11-24T20:08:47.855Z (about 2 months ago)
- Language: Rust
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Benchmark of various hex encoding implementations
This is a research into how implementation of hex formatting affects performance.
Unsurprisingly, bypassing formatting by writing to temporary buffer with reasonable `unsafe` wins.Requires recent nightly to run.
```
test tests::eight::manual_no_buf::sink ... bench: 59 ns/iter (+/- 12)
test tests::eight::manual_no_buf::string ... bench: 110 ns/iter (+/- 24)
test tests::eight::maybe_uninit::sink ... bench: 18 ns/iter (+/- 3)
test tests::eight::maybe_uninit::string ... bench: 46 ns/iter (+/- 10)
test tests::eight::trivial::sink ... bench: 336 ns/iter (+/- 96)
test tests::eight::trivial::string ... bench: 399 ns/iter (+/- 109)
test tests::eight::with_buf::sink ... bench: 21 ns/iter (+/- 6)
test tests::eight::with_buf::string ... bench: 52 ns/iter (+/- 80)
test tests::eight::with_unsafe::sink ... bench: 17 ns/iter (+/- 0)
test tests::eight::with_unsafe::string ... bench: 47 ns/iter (+/- 8)
test tests::empty::manual_no_buf::sink ... bench: 8 ns/iter (+/- 2)
test tests::empty::manual_no_buf::string ... bench: 6 ns/iter (+/- 2)
test tests::empty::maybe_uninit::sink ... bench: 10 ns/iter (+/- 3)
test tests::empty::maybe_uninit::string ... bench: 8 ns/iter (+/- 2)
test tests::empty::trivial::sink ... bench: 7 ns/iter (+/- 1)
test tests::empty::trivial::string ... bench: 6 ns/iter (+/- 1)
test tests::empty::with_buf::sink ... bench: 13 ns/iter (+/- 4)
test tests::empty::with_buf::string ... bench: 13 ns/iter (+/- 3)
test tests::empty::with_unsafe::sink ... bench: 10 ns/iter (+/- 2)
test tests::empty::with_unsafe::string ... bench: 8 ns/iter (+/- 1)
test tests::four::manual_no_buf::sink ... bench: 32 ns/iter (+/- 3)
test tests::four::manual_no_buf::string ... bench: 64 ns/iter (+/- 151)
test tests::four::maybe_uninit::sink ... bench: 17 ns/iter (+/- 2)
test tests::four::maybe_uninit::string ... bench: 44 ns/iter (+/- 14)
test tests::four::trivial::sink ... bench: 176 ns/iter (+/- 58)
test tests::four::trivial::string ... bench: 204 ns/iter (+/- 59)
test tests::four::with_buf::sink ... bench: 23 ns/iter (+/- 8)
test tests::four::with_buf::string ... bench: 56 ns/iter (+/- 14)
test tests::four::with_unsafe::sink ... bench: 15 ns/iter (+/- 2)
test tests::four::with_unsafe::string ... bench: 45 ns/iter (+/- 9)
test tests::one::manual_no_buf::sink ... bench: 13 ns/iter (+/- 3)
test tests::one::manual_no_buf::string ... bench: 41 ns/iter (+/- 17)
test tests::one::maybe_uninit::sink ... bench: 15 ns/iter (+/- 2)
test tests::one::maybe_uninit::string ... bench: 44 ns/iter (+/- 14)
test tests::one::trivial::sink ... bench: 50 ns/iter (+/- 6)
test tests::one::trivial::string ... bench: 73 ns/iter (+/- 19)
test tests::one::with_buf::sink ... bench: 17 ns/iter (+/- 3)
test tests::one::with_buf::string ... bench: 50 ns/iter (+/- 16)
test tests::one::with_unsafe::sink ... bench: 15 ns/iter (+/- 5)
test tests::one::with_unsafe::string ... bench: 43 ns/iter (+/- 12)
test tests::sixteen::manual_no_buf::sink ... bench: 112 ns/iter (+/- 30)
test tests::sixteen::manual_no_buf::string ... bench: 212 ns/iter (+/- 63)
test tests::sixteen::maybe_uninit::sink ... bench: 23 ns/iter (+/- 5)
test tests::sixteen::maybe_uninit::string ... bench: 56 ns/iter (+/- 15)
test tests::sixteen::trivial::sink ... bench: 641 ns/iter (+/- 35)
test tests::sixteen::trivial::string ... bench: 806 ns/iter (+/- 160)
test tests::sixteen::with_buf::sink ... bench: 29 ns/iter (+/- 7)
test tests::sixteen::with_buf::string ... bench: 62 ns/iter (+/- 10)
test tests::sixteen::with_unsafe::sink ... bench: 23 ns/iter (+/- 6)
test tests::sixteen::with_unsafe::string ... bench: 58 ns/iter (+/- 22)
test tests::thirtytwo::manual_no_buf::sink ... bench: 244 ns/iter (+/- 39)
test tests::thirtytwo::manual_no_buf::string ... bench: 377 ns/iter (+/- 126)
test tests::thirtytwo::maybe_uninit::sink ... bench: 37 ns/iter (+/- 6)
test tests::thirtytwo::maybe_uninit::string ... bench: 68 ns/iter (+/- 20)
test tests::thirtytwo::trivial::sink ... bench: 1,292 ns/iter (+/- 293)
test tests::thirtytwo::trivial::string ... bench: 1,606 ns/iter (+/- 406)
test tests::thirtytwo::with_buf::sink ... bench: 47 ns/iter (+/- 35)
test tests::thirtytwo::with_buf::string ... bench: 81 ns/iter (+/- 26)
test tests::thirtytwo::with_unsafe::sink ... bench: 40 ns/iter (+/- 6)
test tests::thirtytwo::with_unsafe::string ... bench: 80 ns/iter (+/- 15)
test tests::two::manual_no_buf::sink ... bench: 21 ns/iter (+/- 4)
test tests::two::manual_no_buf::string ... bench: 48 ns/iter (+/- 8)
test tests::two::maybe_uninit::sink ... bench: 15 ns/iter (+/- 2)
test tests::two::maybe_uninit::string ... bench: 45 ns/iter (+/- 15)
test tests::two::trivial::sink ... bench: 97 ns/iter (+/- 35)
test tests::two::trivial::string ... bench: 113 ns/iter (+/- 10)
test tests::two::with_buf::sink ... bench: 19 ns/iter (+/- 6)
test tests::two::with_buf::string ... bench: 52 ns/iter (+/- 12)
test tests::two::with_unsafe::sink ... bench: 15 ns/iter (+/- 3)
test tests::two::with_unsafe::string ... bench: 45 ns/iter (+/- 14)
```