Open
Description
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
While reviewing #7263 from @zhuqi-lucas I noticed that the json reader is allocating a new for each string field it parses
arrow-rs/arrow-json/src/reader/string_array.rs
Lines 110 to 120 in f4fde76
Describe the solution you'd like
I would like to make the json reader faster by not allocating in the inner loop
Describe alternatives you've considered
I think instead of doing
for ... {
builder.append_value(n.to_string())
}
A typically faster pattern is
// temp buffer
let mut s = String::new();
for ... {
s.clear(); // reuse allocation
write!(&mut s, "{n}");
builder.append_value(s)
}
Additional context