Skip to content

Conversation

@alamb
Copy link
Contributor

@alamb alamb commented Jan 15, 2026

Which issue does this PR close?

Rationale for this change

Let's make arrow-rs the fastest we can and the fewer allocations the better

What changes are included in this PR?

Apply pattern from #9114

Are these changes tested?

Existing tests

Are there any user-facing changes?

No

@github-actions github-actions bot added the arrow Changes to the arrow crate label Jan 15, 2026
@alamb alamb force-pushed the alamb/list_view_array branch from f7d8a97 to 72d0fcc Compare January 15, 2026 13:33
)));
}

let values = data.child_data()[0].clone();
Copy link
Contributor Author

@alamb alamb Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here is a clone of ArrayData (which requires an extra Vec allocaton) which is no longer needed

@alamb
Copy link
Contributor Author

alamb commented Jan 16, 2026

@brancz sorry I meant to tag you on this PR given your effort working on ListViewArray recently

@jhorstmann
Copy link
Contributor

I'm confused, this looks to be the same change as the one for ListArray (#9194).

@alamb
Copy link
Contributor Author

alamb commented Jan 17, 2026

I'm confused, this looks to be the same change as the one for ListArray (#9194).

That is a great catch -- thank you -- fixed

))
})?;

let values = data.child_data()[0].clone();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This saves a real clone of ArrayData (and thus an allocation)

let value_sizes = ScalarBuffer::new(sizes_buffer, offset, len);

Ok(Self {
data_type: data.data_type().clone(),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This saves a DataType::drop and a clone of NullBuffer -- probably not a huge deal but unecessary

@jhorstmann
Copy link
Contributor

Looks good 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arrow Changes to the arrow crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants