Skip to content

Optimize axis-independent reduction functions for OffsetRanges #201

@jishnub

Description

@jishnub

Currently

julia> @btime sum(a) setup = (a = OffsetVector(1:rand(10000:10000),3));
  3.851 μs (0 allocations: 0 bytes)

julia> @btime sum(a.parent) setup = (a = OffsetVector(1:rand(10000:10000),3));
  4.262 ns (0 allocations: 0 bytes)

Is there a way to use the fact that the parent is an AbstractRange and avoid iterating over it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions