alamb commented on code in PR #7819:
URL: https://github.com/apache/arrow-rs/pull/7819#discussion_r2197565464


##########
arrow-json/Cargo.toml:
##########
@@ -50,6 +50,8 @@ chrono = { workspace = true }
 lexical-core = { version = "1.0", default-features = false}
 memchr = "2.7.4"
 simdutf8 = "0.1.5"
+ryu = "1.0"

Review Comment:
   I was concerned about adding these new dependencies, however, it seems 
serde_json already depends on `ryu` and `ito` so this is not a net-new 
dependency, it is just now explicit. 
   
   ```toml
   name = "serde_json"
   version = "1.0.140"
   source = "registry+https://github.com/rust-lang/crates.io-index";
   checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373"
   dependencies = [
    "itoa",
    "memchr",
    "ryu",
    "serde",
   ]
   ```



##########
arrow-json/src/reader/string_array.rs:
##########
@@ -103,20 +109,20 @@ impl<O: OffsetSizeTrait> ArrayDecoder for 
StringArrayDecoder<O> {
                 TapeElement::I64(high) if coerce_primitive => match tape.get(p 
+ 1) {
                     TapeElement::I32(low) => {
                         let val = ((high as i64) << 32) | (low as u32) as i64;
-                        builder.append_value(val.to_string());
+                        builder.append_value(int_formatter.format(val));

Review Comment:
   FWIW saving the string allocation also likely makes a non trivial difference



-- 
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]

Reply via email to