Skip to content

Pass more array information #46

@johnnychen94

Description

@johnnychen94

Some trivial information queries become time-consuming because currently there's no way to pass this extra information. And it just falls back to apply the function again and again and again and becomes very inefficient.

using TestImages, ImageTransformations
img = testimage("cameraman")

As = mappedarray->imrotate(img, θ, axes(img)), -π/4:π/16:π/4);

@btime size.($As);  # 22.033 ms (136 allocations: 2.26 MiB)
@btime collect($As); # 22.880 ms (127 allocations: 2.26 MiB)

For this very specific case, axes can be known prior.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions