On 9/13/06, Francesc Altet <[EMAIL PROTECTED]> wrote:
> Well, it seems that malloc actually takes more time when asking for more
> space. However, this can't be the reason why Pierre is seeing that:
>
> a = numpy.exp(a)  [1]
>
> is slower than
>
> numpy.exp(a,out=a)  [2]
>
> as I'd say that this increment in time is negligible compared with
> processing times of those big arrays. In fact, here are my times:
>
> >>> Timer("a = numpy.exp(a)", "import numpy;a =
> numpy.random.rand(2048,2048) + 1j *
> numpy.random.rand(2048,2048)").repeat(3,1)
> [2.5527338981628418, 2.5427830219268799, 2.5074479579925537]
> >>> Timer("numpy.exp(a,out=a)", "import numpy;a =
> numpy.random.rand(2048,2048) + 1j *
> numpy.random.rand(2048,2048)").repeat(3,1)
> [2.5298278331756592, 2.5082788467407227, 2.5222280025482178]
>
> So, both times are comparable.

Yeah, sorry about that: I had not checked carefully the timing. It
seemed slower to me, but you're right, this is not a problem as long
as there is enough free RAM. Ok, I'll go back to my coding and do like
I should always do: care about optimization later.

Thanks for all the comments and explanations!

Pierre

-- 
Pierre Thibault
616 Clark Hall, Cornell University
(607) 255-5522

-------------------------------------------------------------------------
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