[Python-Dev] 2.6 rc1 performance results

A.M. Kuchling amk at amk.ca
Sat Sep 13 14:03:50 CEST 2008


Three weeks ago, Antoine Pitrou posted the pybench results 
for 2.6 trunk:
http://mail.python.org/pipermail/python-dev/2008-August/081951.html

The big discovery in those results were TryExcept being 48% slower,
but there was a patch in the bug tracker to improve things.  I've
re-run the tests to check the results.

Disclaimer: these results are probably not directly comparable.
Antoine was using a "32-bit Linux installation on an Athlon 3600+ X2";
I'm on a Macbook.

Good news: TryExcept is now only 10% slower than 2.5, not 48%.

Bad news: the big slowdowns are:

                 CompareFloats:   117ms    98ms  +19.2%   118ms    99ms  +19.0%
               CompareIntegers:   110ms   104ms   +5.6%   110ms   105ms   +4.9%
            DictWithStringKeys:   118ms   105ms  +12.8%   133ms   108ms  +22.7%
                NestedForLoops:   125ms   116ms   +7.7%   127ms   118ms   +8.0%
                     Recursion:   193ms   159ms  +21.5%   197ms   163ms  +20.8%
                  SecondImport:   139ms   129ms   +8.4%   143ms   130ms   +9.9%
           SecondPackageImport:   150ms   139ms   +8.6%   152ms   140ms   +8.1%
         SecondSubmoduleImport:   211ms   191ms  +10.5%   214ms   195ms   +9.4%
       SimpleComplexArithmetic:   130ms   119ms   +9.4%   131ms   120ms   +9.2%

Antoine, your Recursion results were actually about the same (+2.2%)
from 2.5 to 2.6, so this big slowdown is novel.  I wonder if these
tests are simply slower on MacOS for some reason (compiler, CPU cache
size, etc.).  Does anyone see similar results?  Any idea what might
have made DictForStringKeys and Recursion slow down?

Complete results:

Test                             minimum run-time        average  run-time
                                 this    other   diff    this    other   diff
-------------------------------------------------------------------------------
          BuiltinFunctionCalls:   140ms   148ms   -5.4%   142ms   153ms   -7.5%
           BuiltinMethodLookup:   120ms   135ms  -11.2%   122ms   137ms  -11.0%
                 CompareFloats:   117ms    98ms  +19.2%   118ms    99ms  +19.0%
         CompareFloatsIntegers:   109ms   119ms   -8.9%   109ms   121ms   -9.3%
               CompareIntegers:   110ms   104ms   +5.6%   110ms   105ms   +4.9%
        CompareInternedStrings:   128ms   153ms  -16.3%   131ms   158ms  -16.8%
                  CompareLongs:   102ms    99ms   +3.5%   105ms   101ms   +3.9%
                CompareStrings:   164ms   161ms   +2.0%   166ms   165ms   +0.7%
                CompareUnicode:   141ms   158ms  -10.5%   143ms   164ms  -12.6%
    ComplexPythonFunctionCalls:   159ms   272ms  -41.3%   164ms   277ms  -40.6%
                 ConcatStrings:   173ms   168ms   +3.2%   177ms   172ms   +3.1%
                 ConcatUnicode:   108ms   121ms  -10.8%   111ms   124ms  -10.4%
               CreateInstances:   168ms   180ms   -6.4%   176ms   182ms   -3.7%
            CreateNewInstances:   129ms   153ms  -15.6%   132ms   158ms  -16.0%
       CreateStringsWithConcat:   156ms   157ms   -0.7%   158ms   161ms   -1.9%
       CreateUnicodeWithConcat:   112ms   114ms   -1.8%   114ms   117ms   -2.2%
                  DictCreation:   104ms   112ms   -7.1%   106ms   114ms   -7.2%
             DictWithFloatKeys:   149ms   162ms   -7.7%   153ms   168ms   -8.7%
           DictWithIntegerKeys:   123ms   148ms  -16.8%   127ms   151ms  -15.9%
            DictWithStringKeys:   118ms   105ms  +12.8%   133ms   108ms  +22.7%
                      ForLoops:    91ms    88ms   +3.6%    91ms    88ms   +3.0%
                    IfThenElse:   108ms   102ms   +5.2%   109ms   103ms   +5.5%
                   ListSlicing:   155ms   239ms  -35.0%   157ms   241ms  -34.6%
                NestedForLoops:   125ms   116ms   +7.7%   127ms   118ms   +8.0%
          NormalClassAttribute:   135ms   140ms   -3.8%   139ms   146ms   -4.7%
       NormalInstanceAttribute:   123ms   126ms   -2.4%   125ms   130ms   -4.4%
           PythonFunctionCalls:   126ms   126ms   +0.0%   129ms   128ms   +0.9%
             PythonMethodCalls:   165ms   165ms   -0.1%   168ms   170ms   -1.1%
                     Recursion:   193ms   159ms  +21.5%   197ms   163ms  +20.8%
                  SecondImport:   139ms   129ms   +8.4%   143ms   130ms   +9.9%
           SecondPackageImport:   150ms   139ms   +8.6%   152ms   140ms   +8.1%
         SecondSubmoduleImport:   211ms   191ms  +10.5%   214ms   195ms   +9.4%
       SimpleComplexArithmetic:   130ms   119ms   +9.4%   131ms   120ms   +9.2%
        SimpleDictManipulation:   124ms   146ms  -14.6%   128ms   150ms  -14.8%
         SimpleFloatArithmetic:   127ms   132ms   -3.6%   131ms   144ms   -9.3%
      SimpleIntFloatArithmetic:    93ms   100ms   -6.5%    94ms   100ms   -5.6%
       SimpleIntegerArithmetic:    94ms    91ms   +2.8%    95ms    92ms   +3.1%
        SimpleListManipulation:   108ms   110ms   -1.1%   110ms   111ms   -1.2%
          SimpleLongArithmetic:   141ms   136ms   +3.8%   143ms   139ms   +2.8%
                    SmallLists:   157ms   151ms   +4.3%   160ms   156ms   +2.6%
                   SmallTuples:   123ms   123ms   -0.3%   125ms   127ms   -1.5%
         SpecialClassAttribute:   136ms   152ms  -10.5%   140ms   155ms  -10.2%
      SpecialInstanceAttribute:   225ms   256ms  -11.9%   227ms   258ms  -11.8%
                StringMappings:   197ms   206ms   -4.4%   201ms   209ms   -3.8%
              StringPredicates:   154ms   194ms  -20.5%   157ms   196ms  -20.2%
                 StringSlicing:   144ms   146ms   -1.1%   152ms   155ms   -1.9%
                     TryExcept:   111ms   101ms   +9.5%   114ms   102ms  +11.2%
                    TryFinally:   120ms   129ms   -6.9%   122ms   131ms   -6.8%
                TryRaiseExcept:   145ms   150ms   -4.0%   148ms   153ms   -3.2%
                  TupleSlicing:   141ms   140ms   +1.3%   152ms   159ms   -4.5%
               UnicodeMappings:   140ms   133ms   +5.9%   143ms   136ms   +5.5%
             UnicodePredicates:   123ms   137ms   -9.9%   125ms   138ms   -9.9%
             UnicodeProperties:   136ms   146ms   -6.7%   142ms   151ms   -6.3%
                UnicodeSlicing:   132ms   129ms   +2.0%   134ms   131ms   +2.2%
                   WithFinally:   167ms   168ms   -1.0%   172ms   173ms   -0.3%
               WithRaiseExcept:   134ms   150ms  -11.1%   140ms   156ms   -9.8%
-------------------------------------------------------------------------------
Totals:                          7659ms  8031ms   -4.6%  7834ms  8229ms   -4.8%

(this=p26.pybench, other=p25.pybench)


--amk


More information about the Python-Dev mailing list