From 4791d16a8efc42fb40ffab79bcdae4f0e106cd89 Mon Sep 17 00:00:00 2001 From: Matt Mastracci Date: Thu, 7 Mar 2024 10:00:43 -0700 Subject: perf(cli): use faster_hex (#22761) `cli::util::checksum` was showing up on flame graphs because it was concatenating allocated strings. We can use `faster-hex` to improve it. --- ext/node/ops/crypto/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/node/ops/crypto/mod.rs') diff --git a/ext/node/ops/crypto/mod.rs b/ext/node/ops/crypto/mod.rs index f73d96580..39d6b8bd5 100644 --- a/ext/node/ops/crypto/mod.rs +++ b/ext/node/ops/crypto/mod.rs @@ -163,7 +163,7 @@ pub fn op_node_hash_digest_hex( let context = Rc::try_unwrap(context) .map_err(|_| type_error("Hash context is already in use"))?; let digest = context.digest()?; - Ok(hex::encode(digest)) + Ok(faster_hex::hex_string(&digest)) } #[op2(fast)] -- cgit v1.2.3