Python needn't apologize (was: Using Python for programming algorithms)

Cameron Laird claird at lairds.us
Mon May 26 13:49:40 EDT 2008


In article <71dc01f3-0084-4878-a4f0-5792e2648f77 at y21g2000hsf.googlegroups.com>,
sturlamolden  <sturlamolden at yahoo.no> wrote:
>On May 18, 5:46 am, "inhahe" <inh... at gmail.com> wrote:
>
>> The numbers I heard are that Python is 10-100 times slower than C.
>
>Only true if you use Python as if it was a dialect of Visual Basic. If
>you use the right tool, like NumPy, Python can be fast enough. Also
>note that Python is not slower than any other language (including C)
>if the code is i/o bound. As it turns out, most code is i/o bound,
>even many scientific programs.
>
>In scientific research, CPU time is cheap and time spent programming
>is expensive. Instead of optimizing code that runs too slowly, it is
>often less expensive to use fancier hardware, like parallell
>computers. For Python, we e.g. have mpi4py which gives us access to
>MPI. It can be a good advice to write scientific software
>parallelizable from the start.
			.
		[more of same]
			.
			.
I can hardly overemphasize how often it happens not
just that Python is more than 1% as fast as C, not 
just that Python is fast enough, but that real-world
programs written in Python are FASTER then their
homologs coded in C.




More information about the Python-list mailing list