Reputation: 1840
I'm wondering if is reliable migrate my python apps to PYPY. I need improve specifically the perfomance of a lot of python code and twisted based modules that I'm using to scientific monitoring, and I'm thinking with a future approach.
Python foundation doesn't show improve perfomance intentions of CPython, either using some model of pypy or Cython.
There is no need to reinvent the wheel, but Guido seems not to mind the needs of python users.Under this situation, it is difficult to take a direction, what decision to take?
... and definitively I don't want to use another programming language.
PD:Actually I'm using 2.7 version...
Edited: My code has been profiled and tested several times, otherwise I would not be asking...Thanks for you answer Francis, anyway...
Edited: I'd like know more opinions about this...
Upvotes: 3
Views: 1056
Reputation: 31631
I think you have the wrong impression of CPython. CPython is the reference implementation and will always have the latest Python features and the newest versions of Python. Performance is important and CPython performance has increased significantly with every single minor release. CPython is definitely the most "future reliable" of the implementations available today.
However, a very important feature of CPython is bridging to C environments, i.e. running modules written in C which wrap C libraries or which contain finely-tuned C code that does manual memory management. Using C modules places a limit on the amount of exotic runtime stuff you can do. E.g. there is a significant performance penalty in PyPy if you use any Python module written in C, if it runs at all!
You can try PyPy, Cython, IronPython, Jython, etc, and see if it works for you, but expect to be disappointed if you use any C modules.
What should be your approach instead is to profile your code and identify any hotspots or inner loops and optimize them. Since you have an IO-driven app, I strongly suspect that the bulk of your "slowness" has nothing to do with your Python implementation but everything to do with IO-related activities. It could be that it's not your app that needs tuning, but the machine it runs on.
Upvotes: 3