On Thu, Feb 3, 2011 at 1:43 AM, Fredrik Johansson
<fredrik.johans...@gmail.com> wrote:
> On Thu, Feb 3, 2011 at 12:32 AM, Alex Gaynor <alex.gay...@gmail.com> wrote:
>> If you have any benchmarks where we are slower that don't involve longs
>> that'd be great, since for float operations we really should be able to beat
>> up on CPython.
>
> A simple example: mpmath.fp.fsum(mpmath.fp.sqrt(k) for k in xrange(1000000))

A brief follow up.

* PyPy trunk is faster (by quite a bit).

* I noticed that you happily use mixture of old and new style classes.
As of now this is a really bad case for PyPy. Example:

>>>> [isinstance(i, type) for i in mpmath.fp.__class__.__mro__]
[True, True, True, True, False, False, True, True, False, True, True,
True, True, True, True]

when I replace it with newstyle classes it runs much faster

Other things that speed up both CPython and PyPy:

* Put this things into function instead of at global scope

* Use list comprehension instead of generator expression.

That all should make PyPy 3x faster than CPython.

>
> PyPy 1.4 runs this about 2.4 times slower than CPython.
>
> Fredrik
> _______________________________________________
> pypy-dev@codespeak.net
> http://codespeak.net/mailman/listinfo/pypy-dev
>
_______________________________________________
pypy-dev@codespeak.net
http://codespeak.net/mailman/listinfo/pypy-dev

Reply via email to