[Python-Dev] Performance compares

Jeremy Hylton jeremy@digicool.com
Wed, 16 May 2001 18:37:47 -0400 (EDT)


As usual, the results you're reporting are quite different than what I
see on my machine.  I'd like to think that my machine is more normal
than yours, but I expect we're both oddballs <0.2 wink>.  I see
basically the same slowdowns that you see, but the amount of the
slowdown is quite a bit smaller.

I compared current CVS with 1.5.2, both compiled with GCC 2.95.3 and
the -O3 flag; ran pybench of an 800MHz P3 with 256MB RAM running Linux
2.2.17.

Python 1.5.2:
Pystone(1.1) time for 10000 passes = 0.85
This machine benchmarks at 11764.7 pystones/second

Python CVS:
Pystone(1.1) time for 10000 passes = 0.94
This machine benchmarks at 10638.3 pystones/second

PYBENCH 0.9

Benchmark: cvs (rounds=10, warp=100)

Tests:                              per run    per oper.  diff *
------------------------------------------------------------------------
          BuiltinFunctionCalls:      41.85 ms    1.64 us  +31.40%
                 CompareFloats:      39.60 ms    0.44 us  +13.96%
         CompareFloatsIntegers:
               CompareIntegers:
                  CompareLongs:      39.85 ms    0.44 us  +15.01%
                CompareStrings:
                CompareUnicode:
                 ConcatStrings:      48.65 ms    1.62 us  +46.76%
                 ConcatUnicode:
               CreateInstances:      75.75 ms    9.02 us  +55.54%
       CreateStringsWithConcat:      51.60 ms    1.29 us  +62.78%
       CreateUnicodeWithConcat:
                  DictCreation:      87.80 ms    2.93 us  +115.72%
             DictWithFloatKeys:
           DictWithIntegerKeys:
            DictWithStringKeys:
                      ForLoops:      63.85 ms   31.93 us  -13.60%
                    IfThenElse:
                   ListSlicing:
                NestedForLoops:      32.95 ms    0.66 us  +10.39%
          NormalClassAttribute:
       NormalInstanceAttribute:
           PythonFunctionCalls:      48.85 ms    1.48 us  +11.78%
             PythonMethodCalls:      38.95 ms    2.60 us  +12.09%
                     Recursion:
                  SecondImport:      37.80 ms    7.56 us  +65.79%
           SecondPackageImport:      38.95 ms    7.79 us  +50.68%
         SecondSubmoduleImport:      49.90 ms    9.98 us  +35.05%
       SimpleComplexArithmetic:      58.95 ms    1.34 us  +74.67%
        SimpleDictManipulation:
         SimpleFloatArithmetic:
      SimpleIntFloatArithmetic:
       SimpleIntegerArithmetic:
        SimpleListManipulation:      43.65 ms    0.81 us  +15.63%
          SimpleLongArithmetic:      42.70 ms    1.29 us  +53.32%
                    SmallLists:      79.15 ms    1.55 us  +56.89%
                   SmallTuples:      66.65 ms    1.39 us  +43.03%
         SpecialClassAttribute:
      SpecialInstanceAttribute:
                StringMappings:
              StringPredicates:
                 StringSlicing:      39.00 ms    1.11 us  +28.71%
                     TryExcept:
                TryRaiseExcept:      50.60 ms   16.87 us  +27.46%
                  TupleSlicing:      37.90 ms    1.80 us  +26.54%
               UnicodeMappings:
             UnicodePredicates:
             UnicodeProperties:
                UnicodeSlicing:
------------------------------------------------------------------------
            Average round time:    3177.00 ms                n/a

*) measured against: 1.5.2 (rounds=10, warp=100)

(As MAL did, I removed all the results were the difference is +/-
10%.)

i-never-do-simple-complex-arithmetic-anyway-ly yr's,
Jeremy