[pypy-issue] [issue733] bz2 decompression is very slow

Jonas H. tracker at bugs.pypy.org
Fri Aug 26 22:17:08 CEST 2011


Jonas H. <jonas at lophus.org> added the comment:

Here are some cProfile stats using PyPy and this benchmark script

    import os, tarfile, tempfile
    tarfile.open("x.tar.gz").extractall(tempfile.mkdtemp())

where "x.tar.gz" is created using

    apack x.tar.gz /opt/pypy/lib_pypy/

CPython 2.7.2 takes 0.8 seconds to decompress this whereas PyPy 1.6 takes 4 seconds.


$ pypy -m cProfile -s time bench.py
         498680 function calls (495247 primitive calls) in 4.027 seconds

   Ordered by: internal time

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
      2/1    0.698    0.349    3.666    3.666 tarfile.py:2025(extractall)
     2436    0.315    0.000    1.341    0.001 shutil.py:45(copyfileobj)
     6003    0.224    0.000    0.963    0.000 tarfile.py:798(read)
     2436    0.218    0.000    1.559    0.001 tarfile.py:259(copyfileobj)
    10207    0.206    0.000    0.206    0.000 {struct.unpack}
    22213    0.203    0.000    0.685    0.000 gzip.py:232(read)
     4311    0.200    0.000    0.200    0.000 {method 'decompress' of 'Decompress' objects}

  [...snip...]


Could we get this issue fixed sooner if I contributed a benchmark case for speed.pypy.org?

________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue733>
________________________________________


More information about the pypy-issue mailing list