News for hackers. Stuff that matters.
Re:PyPy's future directions by odiroot on Sunday October 09, 2011 @01:10AM (#3089728)
I have been recently porting to Python (with NumPy) some badly written C++ code. I was really shocked that the performance drops nearly 100 times (because of many nested loops).

NumPy working on PyPy would probably get me really near original performance. And it's not the advanced features I hope for -- ndarray and basic linalg operations is all I need to do my thesis.

Anyway guys, great job so far, looking forward to the future.

Re:PyPy's future directions by cdavid on Sunday October 09, 2011 @04:17AM (#3089997)
If you have nested loops, numpy will indeed not help you. Numpy per-item access is actually slower than python usual container (list, tuple). You could post the code that is actually slow, so that one could help you to make it faster.

As for pypy helping you, I hope that's the case. But what's in pypy today has not much to do with numpy, in the sense it is a complete re-implementation from scratch.

Re:PyPy's future directions by bugsbunnyak on Sunday October 09, 2011 @11:39AM (#3090616)
Have a look at suggestions here:

http://scipy-lectures.github.com/advanced/optimizing/index.h...

By far the most important first-order optimizization is to vectorize your computations.

Re:PyPy's future directions by femngi on Sunday October 09, 2011 @12:45PM (#3090745)
You should read http://www.scipy.org/PerformancePython if you haven't already seen it since it deals with the performance of nested loops. The only issue I guess would be portability, for example to PyPy.
Re:PyPy's future directions by odiroot on Monday October 10, 2011 @04:11AM (#3092762)
I totally missed this guide. I'd definitely use Cython to optimize this.

Previously I used Cython to wrap original C++ code and it performed really well but I got numerical differences in result.

Re:PyPy's future directions by fijal on Sunday October 09, 2011 @12:50PM (#3090756)
This does not cover PyPy and under PyPy behavior of those methods will be Very different.