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


##########
arrow-json/src/reader/list_array.rs:
##########
@@ -93,15 +93,14 @@ impl<O: OffsetSizeTrait> ArrayDecoder for 
ListArrayDecoder<O> {
 
         let child_data = self.decoder.decode(tape, &child_pos)?;
         let nulls = nulls.as_mut().map(|x| NullBuffer::new(x.finish()));
+        let values = make_array(child_data);
+        let field = match &self.data_type {
+            DataType::List(f) | DataType::LargeList(f) => f.clone(),
+            _ => unreachable!(),
+        };
+        let offsets = 
OffsetBuffer::<O>::new(ScalarBuffer::from(offsets.finish()));

Review Comment:
   One additional source of slowdown could be that `OffsetBuffer::new` 
validates all the offsets -- see
   
   
https://github.com/apache/arrow-rs/blob/6931d881d88b515574133e4edda7757b5ee2dd56/arrow-buffer/src/buffer/offset.rs#L68-L78
   
   I think it would be appropriate here to use `OffsetBuffer::new_unchecked`



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