summaryrefslogtreecommitdiff
path: root/ext/node
diff options
context:
space:
mode:
authorMatt Mastracci <matthew@mastracci.com>2024-03-07 10:00:43 -0700
committerGitHub <noreply@github.com>2024-03-07 10:00:43 -0700
commit4791d16a8efc42fb40ffab79bcdae4f0e106cd89 (patch)
tree3d91c75b0d822ba68797da8a33091597f99f7af6 /ext/node
parent594d8397ad46a90389bec9a76afde1bc7f1fa35b (diff)
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.
Diffstat (limited to 'ext/node')
-rw-r--r--ext/node/Cargo.toml2
-rw-r--r--ext/node/ops/crypto/mod.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/ext/node/Cargo.toml b/ext/node/Cargo.toml
index cd03c53fe..3f417bb01 100644
--- a/ext/node/Cargo.toml
+++ b/ext/node/Cargo.toml
@@ -32,8 +32,8 @@ dsa = "0.6.1"
ecb.workspace = true
elliptic-curve.workspace = true
errno = "0.2.8"
+faster-hex.workspace = true
h2 = { version = "0.3.17", features = ["unstable"] }
-hex.workspace = true
hkdf.workspace = true
http_v02.workspace = true
idna = "0.3.0"
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)]