Making Python math 196* faster with shedskin
Thursday, November 20th, 2008On my personal blog I have written a long entry on Making Python math 196* faster with shedskin.
I compared stock Python 2.5, Psyco and ShedSkin output on an artificial neural network problem. The goal was to quickly estimate how fast a C version might solve the problem without having to actually write C (thus saving hours, sweat and tears). ShedSkin converts Python code to C++ for compilation with g++.
Psyco speeds things up by a factor of 2.6, ShedSkin by a super-impressive 196 times.
Leonardo Maffi has continued the benchmarks and shows that hand-coded C is between 1.5 and 7 times faster than ShedSkin’s output. Auto-generated code that is within a order of magnitude of hand-written code is darned impressive in my book!
He also notes the difficulty of writing a bug-free C version vs the simplicity of dealing with Python (and D) code.
As a side note - Mark Dufour and team at ShedSkin are interested in having extra hands help with the push to a 0.1 release which supports enough Python to be useful to many.