Soduku

Jonathan Gardner jgardner at jonathangardner.net
Tue Feb 14 20:32:48 EST 2006


Here at my job, Python gets no respect.

A programmer here wanted to see which language among Python, Perl, and
Java was better. So he wrote a Python, perl, and Java version. Except
the Python version was 20x slower than the perl and Java versions.

Well, luckily he asked around in our little Python group about what he
did wrong. He simply misindented a block of code, making it run 10x as
often as it needed to. With that one fix, it was running faster than
the Java and perl versions, about 2x as fast. A few other minor tweaks
made it run even faster.

And we've been playing with different algorithms for soduku solutions.
I had it down to 27 ms to solve the puzzle.

So, one more story on why Python is really good. I think, at least with
2.4, we should start bragging about Python's speed. I mean, it beats
Java AND perl!




More information about the Python-list mailing list