Dijkstra on Python

James J. Besemer jb at cascade-sys.com
Sat Aug 17 09:35:48 CEST 2002

"Christopher A. Craig" wrote:

> Have you ever actually done timing tests?

Yes, as elaborated in my reply to gbreed, or I wouldn't
have made the claim in the first place.

I noticed another difference between my benchmarks
and gbreed's and possibly yours: he definitely and possibly
you include generating the list data in the run time while I
generate the list data before measuring the effect of the
construct in question.

FWIW, when I run YOUR tests on my machine (with data
generation factored out), I get different results:

    lambda_:  0.471095769706
    listcomp: 0.538330365556
    natural:  0.543659546563

Lambda again comes out first, though list comp beats
for loop by a nose for second place.


James J. Besemer  503-280-0838 voice
http://cascade-sys.com  503-280-0375 fax
mailto:jb at cascade-sys.com

More information about the Python-list mailing list