Skip to content

Speedup take_bytes by precalculating capacity #7432

@Dandandan

Description

@Dandandan

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

We can precalculate the capacity of the value in take_bytes based on the offsets, while building the offsets.
This is faster than letting the buffer allocate for us.
As a bonus, we also save some memory by precisely allocating the resulting buffer, instead of overallocating.

Describe the solution you'd like

Describe alternatives you've considered

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    arrowChanges to the arrow crateenhancementAny new improvement worthy of a entry in the changelogperformance

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions