uuidtoa
Optimized serialization of hyphenated UUID ASCII representation to io::Write
sinks.
The two functions exported by this crate are write_lower
and write_upper
;
here are their signatures:
;
;
An example of writing this out to a buffer would be
let uuid = from_str.unwrap;
let mut buf: = Vec with_capacity;
write_lower.unwrap;
This performs approximately 10x better than the equivalent fmt::Display
impl
from the uuid crate.
let uuid = from_str.unwrap;
let buf = format!;
The benchmarks from these two approaches are as follows.
test benches::bench_fmt ... bench: 522 ns/iter (+/- 6)
test benches::bench_lower ... bench: 45 ns/iter (+/- 0)
To run them for yourself, the bench feature and nightly compiler should be used.