Skip to content

[C++] Avoid repeated ArrayData::offset lookups in concrete Array classes #44194

@pitrou

Description

@pitrou

Describe the enhancement requested

Lookup functionality in concrete array classes can be invoked repeatedly in some operations, e.g. the sort kernels which access multiple array chunks in random order:

const value_type* raw_values() const {
return reinterpret_cast<const value_type*>(raw_values_) + data_->offset;
}
value_type Value(int64_t i) const { return raw_values()[i]; }

The compiler might always not be able to hoist the data_->offset lookup out of loops, therefore it would be useful to avoid it altogether.

Component(s)

C++

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions