Peter Maas schrieb:
> 1 runs of nbody.py, time in sec
Correction: 1 iterations of advance().
--
Regards/Gruesse,
Peter Maas, Aachen
E-mail 'cGV0ZXIubWFhc0B1dGlsb2cuZGU=\n'.decode('base64')
--
http://mail.python.org/mailman/listinfo/python-list
Richard Jones wrote:
> Giovanni Bajo wrote:
[...]
>> Anyway, this is a bug on its own I believe. I don't think new-style
>> classes are meant to be 25% slower than old-style classes. Can any guru
>> clarify this?
>
> Please try 2.5 - there's been significant optimisation work put into 2.5
I check
Giovanni Bajo wrote:
> Peter Maas wrote:
>
>>> Did you try using an old-style class instead of a new-style class?
>>
>> The original program has an old style class, changing it to a new
>> style class increases run time by 25% (version is 2.4.3 btw).
>
> Ah yes. Years ago when I first saw this t
Peter Maas wrote:
>> Did you try using an old-style class instead of a new-style class?
>
> The original program has an old style class, changing it to a new
> style class increases run time by 25% (version is 2.4.3 btw).
Ah yes. Years ago when I first saw this test it was still using new-style
c
Peter Maas wrote:
> Paul McGuire wrote:
> > The advance method is the most fertile place for optimization, since it is
> > called approximately n(n-1)/2 times (where n=2E7). I was able to trim about
> > 25% from the Python runtime with these changes:
> [...]
>
> My results:
>
> Your changes: 18%
Paul McGuire wrote:
> The advance method is the most fertile place for optimization, since it is
> called approximately n(n-1)/2 times (where n=2E7). I was able to trim about
> 25% from the Python runtime with these changes:
[...]
My results:
Your changes: 18% runtime decrease
Your changes + o
Giovanni Bajo wrote:
> Did you try using an old-style class instead of a new-style class?
The original program has an old style class, changing it to a new
style class increases run time by 25% (version is 2.4.3 btw).
--
Regards/Gruesse,
Peter Maas, Aachen
E-mail 'cGV0ZXIubWFhc0B1dGlsb2cuZGU=\n
[EMAIL PROTECTED] wrote:
>> You might also put the outer loop calling function advance so many
>> times, into the advance function:
>
> Remember that the autors of the Shootout refuse some changes to the
> code (like this one), to allow a fair comparison. The rules are strict.
I'm only aware of t
Paddy:
> You might also put the outer loop calling function advance so many
> times, into the advance function:
Remember that the autors of the Shootout refuse some changes to the
code (like this one), to allow a fair comparison. The rules are strict.
I have improved the Psyco version:
http://sho
Peter Maas wrote:
> 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
[EMAIL PROTECTED] wrote:
> [EMAIL PROTECTED] wrote:
> > Ah, wait a moment. One more tweak. Make the body class a psyco class.
> > That improves the runtime to 3.02s. Diff appended.
>
> Nice. Maybe you can do the same trick with:
> from psyco.classes import __metaclass__
>
> If you want you can
Matteo wrote:
> Of course, numpy is not a standard package (though there is a proposal
> to add a standard 'array' package to python, based of numpy/numeric),
> but if you want to do any numerics with python, you shouldn't be
> without it.
I know that nbody.py could be speeded up by psyco and nump
John J. Lee wrote:
> 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).
I tried this also but got only 90%. Strange.
--
Regards/Gruesse,
[EMAIL PROTECTED] wrote:
> Ah, wait a moment. One more tweak. Make the body class a psyco class.
> That improves the runtime to 3.02s. Diff appended.
Nice. Maybe you can do the same trick with:
from psyco.classes import __metaclass__
If you want you can try that trick with this version of mine
"Peter Maas" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>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 Py
Skip> I took the original version, tweaked it slightly (probably did
Skip> about the same things as Python #2, I didn't look). For N ==
Skip> 200,000 the time went from 21.94s (user+sys) to 17.22s. Using
Skip> psyco and binding just the advance function on my improved version
Peter Maas wrote:
> 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
On 2006-10-06, Peter Maas <[EMAIL PROTECTED]> wrote:
> 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
Peter> I have noticed that in the language shootout at
Peter> shootout.alioth.debian.org the Python program for the n-body
Peter> problem is about 50% slower than the Perl program. This is an
Peter> unusual big difference. I tried to make the Python program faster
Peter> but wi
Peter Maas:
> 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 explan
Peter Maas <[EMAIL PROTECTED]> 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 su
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 differ
22 matches
Mail list logo