Re:Guido van Rossum's Performance tips for Python
by jrockway on Sunday October 14, 2012 @03:00AM
(#4650883)
C is also unpredictable: see the article from a couple days ago entitled "Why does my function run faster when the input array is sorted?"
(The answer was: branch prediction.)
Re:Guido van Rossum's Performance tips for Python
by to3m on Sunday October 14, 2012 @10:27AM
(#4651482)
I'm not sure that counts in the same way. You would have the branch prediction issue even if you program in assembly language and have precise control over the instructions the computer executes.
In CPython land, Python is slower, but performs predictably, and if you want to speed it up you write C, which is much faster, and also performs predictably, though it takes some developer effort. In PyPy, you get some of the speed of C without the effort, but without the predictability either.