Re: [Numpy-discussion] Faster fill
by Travis Oliphant other posts by this author
Feb 27 2006 4:44PM messages near this date
[Numpy-discussion] Faster fill
|
Re: [Numpy-discussion] Faster fill
Sasha wrote:
> I''ve just posted a patch at
> http://projects.scipy.org/scipy/numpy/wiki/PossibleOptimizationAreas
> that results in a 6-14x speed-up of ndarray.fill for simple
> datatypes. That's a bigger change than what I am confortable
> submiting to svn without a review. Also since I am not familiar with
> record arrays, I am not sure whether or not this change would break
> anything in that area. Finally, the patch only adresses a
> single-segment case, "strided" arrays would still use old code.
>
>
This looks like a good proceedure. For those less familiar with the
code. Sasha added an additional "data-type-function" to the structure
of data-type-specific functions. Each builtin data-type has a pointer
to a list of functions. A while ago I moved these functions out from
the data-type object so that they could grow.
This is probably a good fundamental operation for speeding up.
I would probably also not define the misaligned case, but just use the
default code for that case as well. This is consistent with the idea
that misaligned data will have slower operations.
To make your code work for record arrays you need to handle the VOID
case. I would just not define it for the void case at this point.
Several other data-type functions need to be improved to handle record
arrays (look at setitem and getitem for guidance) better anyway.
You also need to add a check so that if the function pointer is NULL,
the optimized function is not called.
But, generally, this is the right use of the data-type-functions. Good
job.
-Travis
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@[...].net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion
Thread:
Sasha
Travis Oliphant
Sasha
Travis Oliphant
|