Re: [Numpy-discussion] The NumPy Mandelbrot code 16x slower than Fortran

2012-01-27 Thread Stéfan van der Walt
Hey, Ondřej 2012/1/21 Ondřej Čertík : > I read the Mandelbrot code using NumPy at this page: > > http://mentat.za.net/numpy/intro/intro.html I wrote this as a tutorial for beginners, so the emphasis is on simplicity. Do you have any suggestions on how to improve the code without obfuscating the

Re: [Numpy-discussion] The NumPy Mandelbrot code 16x slower than Fortran

2012-01-25 Thread Ondřej Čertík
On Tue, Jan 24, 2012 at 4:33 PM, Mark Wiebe wrote: > 2012/1/21 Ondřej Čertík >> >> >> >> >> Let me know if you figure out something. I think the "mask" thing is >> quite slow, but the problem is that it needs to be there, to catch >> overflows (and it is there in Fortran as well, see the >> "whe

Re: [Numpy-discussion] The NumPy Mandelbrot code 16x slower than Fortran

2012-01-24 Thread Mark Wiebe
2012/1/21 Ondřej Čertík > > > Let me know if you figure out something. I think the "mask" thing is > quite slow, but the problem is that it needs to be there, to catch > overflows (and it is there in Fortran as well, see the > "where" statement, which does the same thing). Maybe there is some >

Re: [Numpy-discussion] The NumPy Mandelbrot code 16x slower than Fortran

2012-01-23 Thread Samuel John
I'd like to add http://git.tiker.net/pyopencl.git/blob/HEAD:/examples/demo_mandelbrot.py to the discussion, since I use pyopencl (http://mathema.tician.de/software/pyopencl) with great success in my daily scientific computing. Install with pip. PyOpenCL does understand numpy arrays. You write

Re: [Numpy-discussion] The NumPy Mandelbrot code 16x slower than Fortran

2012-01-23 Thread Robert Cimrman
On 01/23/12 13:51, Sturla Molden wrote: > Den 23.01.2012 13:09, skrev Sebastian Haase: >> >> I would think that interactive zooming would be quite nice >> ("illuminating") and for that 13 secs would not be tolerable >> Well... it's not at the top of my priority list ... ;-) >> > > Sure, t

Re: [Numpy-discussion] The NumPy Mandelbrot code 16x slower than Fortran

2012-01-23 Thread Sturla Molden
Den 23.01.2012 13:09, skrev Sebastian Haase: > > I would think that interactive zooming would be quite nice > ("illuminating") and for that 13 secs would not be tolerable > Well... it's not at the top of my priority list ... ;-) > Sure, that comes under the 'fast enough' issue. But even

Re: [Numpy-discussion] The NumPy Mandelbrot code 16x slower than Fortran

2012-01-23 Thread Dag Sverre Seljebotn
On 01/23/2012 12:23 PM, Sturla Molden wrote: > Den 23.01.2012 10:04, skrev Dag Sverre Seljebotn: >> On 01/23/2012 05:35 AM, Jonathan Rocher wrote: >>> Hi all, >>> >>> I was reading this while learning about Pytables in more details and the >>> origin of its efficiency. This sounds like a problem wh

Re: [Numpy-discussion] The NumPy Mandelbrot code 16x slower than Fortran

2012-01-23 Thread Sebastian Haase
On Mon, Jan 23, 2012 at 12:23 PM, Sturla Molden wrote: > Den 23.01.2012 10:04, skrev Dag Sverre Seljebotn: >> On 01/23/2012 05:35 AM, Jonathan Rocher wrote: >>> Hi all, >>> >>> I was reading this while learning about Pytables in more details and the >>> origin of its efficiency. This sounds like a

Re: [Numpy-discussion] The NumPy Mandelbrot code 16x slower than Fortran

2012-01-23 Thread Sturla Molden
Den 23.01.2012 10:04, skrev Dag Sverre Seljebotn: > On 01/23/2012 05:35 AM, Jonathan Rocher wrote: >> Hi all, >> >> I was reading this while learning about Pytables in more details and the >> origin of its efficiency. This sounds like a problem where out of core >> computation using pytables would

Re: [Numpy-discussion] The NumPy Mandelbrot code 16x slower than Fortran

2012-01-23 Thread Dag Sverre Seljebotn
On 01/23/2012 05:35 AM, Jonathan Rocher wrote: > Hi all, > > I was reading this while learning about Pytables in more details and the > origin of its efficiency. This sounds like a problem where out of core > computation using pytables would shine since the dataset doesn't fit > into CPU cache: htt

Re: [Numpy-discussion] The NumPy Mandelbrot code 16x slower than Fortran

2012-01-22 Thread Dan Goodman
On 22/01/2012 20:01, Ondřej Čertík wrote: On Sun, Jan 22, 2012 at 3:13 AM, Sebastian Haase wrote: How does the algorithm and timing compare to this one: http://code.google.com/p/priithon/source/browse/Priithon/mandel.py?spec=svna6117f5e81ec00abcfb037f0f9da2937bb2ea47f&r=a6117f5e81ec00abcfb037f

Re: [Numpy-discussion] The NumPy Mandelbrot code 16x slower than Fortran

2012-01-22 Thread Jonathan Rocher
Hi all, I was reading this while learning about Pytables in more details and the origin of its efficiency. This sounds like a problem where out of core computation using pytables would shine since the dataset doesn't fit into CPU cache: http://www.pytables.org/moin/ComputingKernel. Of course C/Cyt

Re: [Numpy-discussion] The NumPy Mandelbrot code 16x slower than Fortran

2012-01-22 Thread Chris Barker
2012/1/22 Ondřej Čertík : > If I have time, I'll try to provide an equivalent Fortran version too, > for comparison. > > Ondrej here is a Cython example: http://wiki.cython.org/examples/mandelbrot I haven't looked to see if it's the same algorithm, but it may be instructive, none the less. -Chr

Re: [Numpy-discussion] The NumPy Mandelbrot code 16x slower than Fortran

2012-01-22 Thread Ondřej Čertík
On Sun, Jan 22, 2012 at 3:13 AM, Sebastian Haase wrote: > How does the algorithm and timing compare to this one: > > http://code.google.com/p/priithon/source/browse/Priithon/mandel.py?spec=svna6117f5e81ec00abcfb037f0f9da2937bb2ea47f&r=a6117f5e81ec00abcfb037f0f9da2937bb2ea47f > > The author of orig

Re: [Numpy-discussion] The NumPy Mandelbrot code 16x slower than Fortran

2012-01-22 Thread Dag Sverre Seljebotn
On 01/22/2012 04:55 AM, Ondřej Čertík wrote: > Hi, > > I read the Mandelbrot code using NumPy at this page: > > http://mentat.za.net/numpy/intro/intro.html > > but when I run it, it gives me integer overflows. As such, I have > fixed the code, so that it doesn't overflow here: > > https://gist.gith

Re: [Numpy-discussion] The NumPy Mandelbrot code 16x slower than Fortran

2012-01-22 Thread Sebastian Haase
How does the algorithm and timing compare to this one: http://code.google.com/p/priithon/source/browse/Priithon/mandel.py?spec=svna6117f5e81ec00abcfb037f0f9da2937bb2ea47f&r=a6117f5e81ec00abcfb037f0f9da2937bb2ea47f The author of original version is Dan Goodman # FAST FRACTALS WITH PYTHON AND NUMP

[Numpy-discussion] The NumPy Mandelbrot code 16x slower than Fortran

2012-01-21 Thread Ondřej Čertík
Hi, I read the Mandelbrot code using NumPy at this page: http://mentat.za.net/numpy/intro/intro.html but when I run it, it gives me integer overflows. As such, I have fixed the code, so that it doesn't overflow here: https://gist.github.com/1655320 and I have also written an equivalent Fortran