High Performance Python I
Why Stack Overflow recommends it
Stack Overflow users link it when answering questions about speeding up slow Python or numpy code, especially with Cython, PyPy or profiling.
Recommended by 4 people across 4 different months, 2012 to 2014.
What it is
A three-hour hands-on tutorial by Ian Ozsvald, recorded at a Python conference, on making Python code faster. It covers profiling, PyPy, Cython, numpy, NumExpr, ShedSkin, multiprocessing, ParallelPython and pyCUDA, with a companion PDF handout.
What people said
Strong rec tbekolay · 2014-07 · Stack Overflow · on “How to use pypy with python existing calculation code?”
Since you're new to Python, I highly recommend taking the time to survey all of the possibilities before jumping into something pypy which may not be appropriate for your needs. There are lots of ways to speed up NumPy code, and the best way really depends on exactly what you're doing. A great starting off point is Ian Oszvald's High Performance Python tutorial [this video] . Don't just watch it: follow along and try out the examples! From there, you should think about whether parallelization will help. There are several options for parallelization, like the stdlib's multiprocessing module [LINK] , but a lot of people in the scientific space are using IPython's parallelization capabilities. For l
Recommends Jeremy Brown · 2013-02 · Stack Overflow · on “Python list to Cython”
As for working towards increasing performance, I suggest seeing Ian Ozsvald's Pycon 2012 tutorial starting at this point: [this video] The presentation has information on using cython -a as a tool to help you figure out how the C code is getting generated - this will help you squeeze out further performance improvements.
Recommends michaelkrisper · 2013-05 · Stack Overflow · on “python - fastest way to find unique "words" in a string”
Ok, if you really need this performance, try executing the script with pypy or try converting it to C++ with shedskin or Cython. Here is a very good youtube tutorial for high performance python: [this video]
Recommends Dennis Sakva · 2013-12 · Stack Overflow · on “Looking for a quick way to speed up my code”
You can try Cython [LINK] . It supports numpy and can give you a nice speedup. Here is an introduction and explanation of what needs to be done [this video]
Cites notbad.jpeg · 2012-06 · Stack Overflow · on “avoid expensive setup in timeit.repeat() benchmark”
Have you tried using datetime to do your timing for you? start = datetime.datetime.now() print datetime.datetime.now() - start #prints a datetime.timedelta object` That will give you the time elapsed and you can control where it started with tiny overhead. Edit: This is a video of a guy who uses it also for doing some timing, it seems to be the easiest way to get the running time. [this video]