[pypy-dev] deepcopy slower in PyPy - testing script

David Fraser davidf at sjsoft.com
Thu Sep 8 15:23:26 CEST 2011

On Thursday, September 8, 2011 at 12:58:54 PM, Jorge de Jesus <jmdj at pml.ac.uk> wrote:
> Hi to all
> Thank you for all the answers concerning the topic.
> The deepcopy testing script in issue 767 [1], is working faster in PyPy
> than in CPython, but deepcopy is run on a list of numbers.
> BUT, PyWPS runs a lot of DOM functions and deepcopy calls that pass DOM
> Elements as argument.  Just to add my 2cents, it seems that a deepcopy
> of a complexer object (compared to a number list) is slower in PyPy
> I've managed to replicate the problem in a small script  [2] that is
> slower in PyPy:
> python 2.7.1+ : 0.3057 s
> pypy1.6 (jit): 1.42s
> pypy-c-1.6.svn: 1.23s
> The pypy-c-1.6-svn is a compiled version from the SVN and its
> compilation options can be found here [3] . The tests were done in 32bit
> machine
> Can someone give a look at the testing script and determine why is it
> slow ?!
> Thank you for the support, and I must say that PyPy is an amazing
> project !!!!

I've attached a slightly modified version of your script that uses timeit to measure the time, and takes an argument to specify the number of repeats...

This shows that PyPy gets faster as the JIT kicks in:
python2.7      1000    0.33
python2.7      10000   0.33
python3.2      1000    0.41
python3.2      10000   0.40
pypy   1000    1.29
pypy   10000   0.22
pypy   100000  0.08

Hope that helps


More information about the pypy-dev mailing list