andygrove commented on code in PR #19568:
URL: https://github.com/apache/datafusion/pull/19568#discussion_r2653924382


##########
datafusion/functions/src/crypto/basic.rs:
##########
@@ -157,14 +157,18 @@ pub fn md5(args: &[ColumnarValue]) -> 
Result<ColumnarValue> {
     })
 }
 
-/// this function exists so that we do not need to pull in the crate hex. it 
is only used by md5
-/// function below
+/// Hex encoding lookup table for fast byte-to-hex conversion
+const HEX_CHARS_LOWER: &[u8; 16] = b"0123456789abcdef";
+
+/// Fast hex encoding using a lookup table instead of format strings.
+/// This is significantly faster than using `write!("{:02x}")` for each byte.
 #[inline]
 fn hex_encode<T: AsRef<[u8]>>(data: T) -> String {

Review Comment:
   I tried this, but the difference is tiny, so it may not be worth it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to