[Python-Dev] 2.5a1 Performance

M.-A. Lemburg mal at egenix.com
Tue Apr 18 19:40:15 CEST 2006


Anthony Baxter wrote:
> On Thursday 06 April 2006 04:10, Benji York wrote:
>> On a related note: it might be nice to put a pystone run in the
>> buildbot so it'd be easier to compare pystones across different
>> releases, different architectures, and between particular changes
>> to the code. (That's assuming that the machines are otherwise idle,
>> though.) --
> -1.
> 
> A bad benchmark (which pystone is) is much worse than no benchmark.

I could contribute pybench to the Tools/ directory if that
makes a difference:

                pybench -- The Python Benchmark Suite

        Extendable suite of of low-level benchmarks for measuring
              the performance of the Python implementation
                      (interpreter, compiler or VM).

________________________________________________________________________

WHAT IS IT ?:

pybench is a collection of tests that provides a standardized way
to measure the performance of Python implementations. It takes a
very close look at different aspects of Python programs and let's
you decide which factors are more important to you than others,
rather than wrapping everything up in one number, like the other
performance tests do (e.g. pystone which is included in the Python
Standard Library).

pybench has been used in the past by several Python developers to
track down performance bottlenecks or to demonstrate the impact
of optimizations and new features in Python.

There's currently no documentation and no distutils support in
pybench; that'll go into one of the next releases. For now,
please read the source code. The command line interface for pybench
is the file pybench.py. Run this script with option '--help'
to get a listing of the possible options. Without options,
pybench will simply execute the benchmark and then print out
a report to stdout. Here's some sample output:
"""
Tests:                              per run    per oper.   overhead
----------------------------------------------------------------------
          BuiltinFunctionCalls:     131.50 ms    1.03 us    0.50 ms
           BuiltinMethodLookup:     195.85 ms    0.37 us    1.00 ms
                 CompareFloats:     126.00 ms    0.28 us    1.00 ms
         CompareFloatsIntegers:     201.05 ms    0.45 us    0.50 ms
               CompareIntegers:     192.05 ms    0.21 us    2.00 ms
        CompareInternedStrings:     117.65 ms    0.24 us    3.50 ms
...
                     TryExcept:     289.75 ms    0.19 us    3.00 ms
                TryRaiseExcept:     179.05 ms   11.94 us    1.00 ms
                  TupleSlicing:     159.75 ms    1.52 us    0.50 ms
               UnicodeMappings:     171.85 ms    9.55 us    1.00 ms
             UnicodePredicates:     152.05 ms    0.68 us    4.00 ms
             UnicodeProperties:     203.00 ms    1.01 us    4.00 ms
                UnicodeSlicing:     190.10 ms    1.09 us    2.00 ms
----------------------------------------------------------------------
            Average round time:   10965.00 ms
"""

This is the current version:

	http://www.lemburg.com/files/python/pybench-1.2.zip

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Apr 18 2006)
>>> Python/Zope Consulting and Support ...        http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________

::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::


More information about the Python-Dev mailing list