[pypy-dev] profiling pypy

Olivier Dormond olivier.dormond at gmail.com
Thu Oct 20 15:15:27 CEST 2005


 First, congratulation to all pypyers for the great work!

 As I've some spare time at work this week, I just tried to profile
pypy running pystone interactively. The interactive session I used
is below and the pickled result can be found bzip2ed at
Any suggestion for improving it is welcome :-) and actually any idea
how to uses these information in any usefull way would be nice too :-)

[pypy/pypy]$ python
Python 2.4.1 (#2, Oct  8 2005, 00:22:59)
[GCC 4.0.1 (4.0.1-5mdk for Mandriva Linux release 2006.0)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> # From http://codespeak.net/svn/user/arigo/hack/misc/lsprof/
>>> import lsprof
>>> p = lsprof.Profiler()
>>> try:
...   p.enable(True)
...   execfile('bin/py.py')
... except:
...   pass
Loading grammar
faking <type 'module'>
faking <type 'file'>
fake-wrapping interp file <open file '<stdout>', mode 'w' at 0xb7c3a068>
fake-wrapping interp file <open file '<stderr>', mode 'w' at 0xb7c3a0b0>
fake-wrapping interp file <open file '<stdin>', mode 'r' at 0xb7c3a020>
PyPy 0.7.1 in StdObjSpace on top of Python 2.4.1 (startupttime: 5.26 secs)
>>>> import test.pystone
faking <type 'posix.stat_result'>
faking <type 'posix.statvfs_result'>
>>>> test.pystone.main(1000)
Pystone(1.1) time for 1000 passes = 123.84
This machine benchmarks at 8.07494 pystones/second
>>> p.disable()
>>> stats = lsprof.Stats(p.getstats())
>>> stats.freeze()
>>> import cPickle as pickle
>>> pickle.dump(stats, file('profile-results.pickle','w'))



More information about the Pypy-dev mailing list