On 7/7/06, Tim Hochberg <[EMAIL PROTECTED]> wrote:
> The funny thing is that having a dot(a,b,c,...) would lead to the
> exact same kind of hidden performance problems you're arguing against.
Not exactly arguing -- this isn't why I don't like H and friends -- just
noting that this is one of the traps that people are likely to fall into
when transferring equations to code.

There's a strong argument to be made that the whole design of most array math packages is flawed and leads to inefficient code.  The classic example is something like:
  A = B + C - 2*D
where all the matrices are 2million x 2million.  I think for numpy that would basically do:
tmp = B+C
tmp2 = 2*D
tmp3 = tmp - tmp2
A = tmp3

Allocating three huge tmp variables and probably doing an extra copy or two in there, when the best thing to do would be more like:
A = D
A *= -2
A += C
A += B

Or something like that.  The point is that you give up any notion of having optimal code the minute you start using something like numpy.  And you do so happily for the ability to get stuff done faster and have nicer looking, more readable code in the end.  When everything works, that's when you hit the "go fast button" if you even really need to.

--bb
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion

Reply via email to