Skip to content

Reduce overhead to create an Array from ArrayData (make_array) #9061

@alamb

Description

@alamb

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

While looking at profiles for some of the ClickBench queries, I found that almost 1% of the query time was being spent creating record batches from ArrayData,

Screenshot 2025-12-28 at 5 27 02 PM Screenshot 2025-12-28 at 5 29 19 PM

I looked into it and i think the issue is that even though Arrays get an owned ArrayData, they still end up clone ing some things. For some arrays this isn't a big deal (a few Arc updates) for some such as StructArray and ByteViewArray it requires an extra allocation

impl From<ArrayData> for StructArray {

Describe the solution you'd like
I would like to avoid this overhead

Describe alternatives you've considered
I think we can directly construct the arrays from the relevant fields of ArrayData rather than having to clone them

Additional context

Metadata

Metadata

Assignees

Labels

enhancementAny new improvement worthy of a entry in the changelog

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions