diff --git a/Cargo.toml b/Cargo.toml index 41cd9c6..396015b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,6 +33,7 @@ faster-hex = { version = "0.10.0", default-features = false, features = [ ] } hex = { version = "~0.4.2", default-features = false } hex-literal = "0.4" +rustc-hex = "2.1" serde = { version = "1.0", default-features = false, features = ["derive"] } serde_json = { version = "1.0", default-features = false, features = ["alloc"] } diff --git a/benches/bench/main.rs b/benches/bench/main.rs index 06275df..e7e41c5 100644 --- a/benches/bench/main.rs +++ b/benches/bench/main.rs @@ -118,6 +118,19 @@ macro_rules! benches { } )* } + + mod rustc_hex { + use super::*; + + $( + #[bench] + fn $name(b: &mut Bencher) { + b.iter(|| { + ::rustc_hex::FromHex::from_hex::>(black_box($dec)) + }); + } + )* + } } mod decode_to_slice { @@ -209,6 +222,19 @@ macro_rules! benches { } )* } + + mod rustc_hex { + use super::*; + + $( + #[bench] + fn $name(b: &mut Bencher) { + b.iter(|| { + ::rustc_hex::ToHex::to_hex::(&black_box($enc)[..]) + }); + } + )* + } } mod encode_to_slice {