n-body problem at shootout.alioth.debian.org
John J. Lee
jjl at pobox.com
Fri Oct 6 16:23:32 EDT 2006
Peter Maas <peter.maas at somewhere.com> writes:
> I have noticed that in the language shootout at shootout.alioth.debian.org
> the Python program for the n-body problem is about 50% slower than the Perl
> program. This is an unusual big difference. I tried to make the Python program
> faster but without success. Has anybody an explanation for the difference?
> It's pure math so I expected Perl and Python to have about the same speed.
>
> Peter Maas, Aachen
Replacing ** with multiplication in advance() cut it down to 0.78
times the original running time for me. That brings it along side
PHP, one place below Perl (I didn't bother to upload the edited script).
John
More information about the Python-list
mailing list