[pypy-dev] List Slicing Performance Drop

Mohyiddeen Othman mohyiddeen at yahoo.com
Tue May 31 17:35:48 CEST 2011


I thought I did reply? Must've been mistaken. My bad. 

Thanks for the reply. I'm running Windows XP (32-bit) on an Intel Core2Duo E6550 2.33 GHz. I'm using CPython 2.7 and PyPy 1.5

I'm begining to think I'm doing something wrong.

--- On Tue, 5/31/11, Antonio Cuni <anto.cuni at gmail.com> wrote:

From: Antonio Cuni <anto.cuni at gmail.com>
Subject: Re: [pypy-dev] List Slicing Performance Drop
To: "Maciej Fijalkowski" <fijall at gmail.com>
Cc: "Mohyiddeen Othman" <mohyiddeen at yahoo.com>, pypy-dev at python.org
Date: Tuesday, May 31, 2011, 1:07 AM

On 31/05/11 09:13, Maciej Fijalkowski wrote:
> Anto: what version of python did you use? There can be 2.6 vs 2.7 issue

please don't do top posting, it's very confusing on mailing lists :-(

Anyway, the results below are with python2.7. python2.6 is slightly slower,
but not much. I confirm that pypy is faster on my machine.

ciao,
Anto

> On Mon, May 23, 2011 at 10:11 AM, Antonio Cuni <anto.cuni at gmail.com> wrote:
>> On 20/05/11 23:23, Mohyiddeen Othman wrote:
>>> Hi,
>>>
>>> I've been recently doing Project Euler puzzles using Python, and have recently
>>> started to use PyPy to increase performance. However I've come across
>>> something (no pun intended) puzzling. I made this script for Euler #50.
>>>
>>> http://pastebin.com/VZ12Nsci
>>>
>>> It calculates all the primes under 1M first, then looks through them for a
>>> solution. The first part (finding primes) is blazing fast under PyPy (as
>>> expected). But in the second part PyPy lags behind. CPython managed it in
>>> 183s, while PyPy did it in 498s. I'm assuming it has something to do with the
>>> list slicing?
>>
>> I cannot reproduce, for me pypy is faster on both pieces of code:
>>
>> viper ~ $ pypy-c /tmp/euler.py
>> ('All primes below', 1000000, 'found')
>> 0.43
>> Max sequence is:
>> ....
>> ....
>> ('It contains', 543, 'elements')
>> ('The sum is', 997651)
>> 72.61
>>
>>
>> viper ~ $ python /tmp/euler.py
>> ('All primes below', 1000000, 'found')
>> 4.58
>> Max sequence is:
>> ....
>> ....
>> ('It contains', 543, 'elements')
>> ('The sum is', 997651)
>> 128.81
>>
>>
>> Could you tell us more about your environment, like which OS, cpu, 32/64 bit
>> and the exact version of pypy/cpython you used to do the benchmark please?
>>
>> ciao,
>> Anto
>> _______________________________________________
>> pypy-dev mailing list
>> pypy-dev at python.org
>> http://mail.python.org/mailman/listinfo/pypy-dev
>>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20110531/2f65897b/attachment.html>


More information about the pypy-dev mailing list