Skip to content

[Rust] Use slices for iterating primitive arrays #18428

@asfimport

Description

@asfimport

Iterating slices instead of indexes seems to improve performance of non-simd arithmetic operations.

This adds a new method raw_values_slice to PrimitiveArray (so named to pun off of the raw_values function which returns a pointer). A few of the functions in PrimitiveArray rely on the caller for safety guarantees (bounds-checks for value_slice, value), so should probably be unsafe? But they are used widely, so I thought it simpler to start by adding a safer alternative...

Reporter: Tyrel Rink / @tyrelr
Assignee: Tyrel Rink / @tyrelr

Related issues:

PRs and other links:

Note: This issue was originally created as ARROW-10989. Please see the migration documentation for further details.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions