On 12/19/06, Francesc Altet <[EMAIL PROTECTED]> wrote:

A Dimarts 19 Desembre 2006 08:12, David Cournapeau escrigué:
> Hi,
>


<snip>





My guess is that the real bottleneck is in calling so many times
memmove (once per element in the array). Perhaps the algorithm can be
changed to do a block copy at the beginning and then modify only the
places on which the clip should act (kind of the same that you have
made in Python, but at C level).


IIRC, doing a simple type specific assignment is faster than either memmov
or memcpy. If speed is really of the essence it would probably be worth
writing a type specific version of clip. A special function combining clip
with RGB conversion might do even better.

Chuck
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to