Skip to content
This repository was archived by the owner on Dec 15, 2020. It is now read-only.
This repository was archived by the owner on Dec 15, 2020. It is now read-only.

downsample may not be fully optimized #28

@astrofrog

Description

@astrofrog

In APLpy I have a pure-python (well with Numpy) implementation of downsample called resample (which I wrote a while ago) and it turns out it can actually be faster than downsample here which is surprising:

In [1]: from imageutils import downsample

In [4]: from aplpy.image_util import resample

In [6]: image = np.random.random((4096,4096))

In [7]: %timeit resample(image, 10)
10 loops, best of 3: 73.6 ms per loop

In [8]: %timeit downsample(image, 10)
10 loops, best of 3: 85.2 ms per loop

I wonder if the order of the looping has something to do with it, or maybe the fact that we're still accessing a Numpy array from Cython.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions