how fast is Python?
cartermark46 at ukmail.com
Thu Aug 21 14:13:36 CEST 2003
> > However, there are definitely cases where a lot of code would need to
> > be optimized, and so I ask the question: How fast is Python, compared
> > to say a typical optimizing C/C++ compiler?
I did a benchmark some time ago (nothing optimised):
The purpose of this technical report is to gauge the relative speed of
the languages: VB, VBA, Python 2.2, C++, and Fortran.
It was discovered that uncompiled VB code in VB 6.0 ran at the same
speed as VBA code in Excel. It was half the speed of compiled VB code,
5 times the speed of Python, and 1/20th the speed of C++/Fortran.
The following algorithm was implemented in each of the target
X = 0.5
For I = 1 to 108
X = 1 X* X
Timings were made for the execution. The following results were
Language Timing (seconds)
VB uncompiled 74
VB compiled 37
VBA Excel 75
C++ - debug version 4
C++ - release version 3
The timings for Fortran are approximate. The execution time had to be
timed with a stopwatch because timing functions could not be
More information about the Python-list