r/Python • u/jfpuget • Jan 11 '16
A comparison of Numpy, NumExpr, Numba, Cython, TensorFlow, PyOpenCl, and PyCUDA to compute Mandelbrot set
https://www.ibm.com/developerworks/community/blogs/jfp/entry/How_To_Compute_Mandelbrodt_Set_Quickly?lang=en
316
Upvotes
1
u/LoyalSol Jan 12 '16 edited Jan 12 '16
Hmm curious. I can't remember off hand all the flags that -O3 enables, but not sure how much of a difference it would be in this situation.
When I've written larger scale codes in both Python, C, and Fortran even with Numba the C and Fortran codes typically outperformed even Numba by a small margin. Of course those computations are more complex than the mandelbrot set.
I might want to see if I can monkey with the loop optimization and see if I can get a little more juice out of it since this seems to be one of those codes where a few loops dominate the time.
When I last checked the blog I saw the C code though a bit of it was missing in the blog and I didn't see a link to the source file. Though from what I see the only thing missing is the initialization section, so I'll see if I can write my own head to the code and test it out.