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


##########
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:
   I think this still copies the bytes twice -- once into the ryu buffer and 
then again into the StringBuilder's buffer . I suspect we could make it even 
faster by writing into the StringBuilder directly
   
   Note StringBuffer implements `Write` so you can do stuff like
   
https://docs.rs/arrow/latest/arrow/array/type.GenericStringBuilder.html#example-incrementally-writing-strings-with-stdfmtwrite
   
   Is there some way to get ryu to write directly to that buffer?
   
   using ryu may still be faster



-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to