Author vstinner
Recipients vstinner
Date 2016-01-09.09:34:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1452332052.18.0.384050047213.issue26058@psf.upfronthosting.co.za>
In-reply-to
Content
Result of pybench on Dict microbenchmarks:

                  DictCreation:    44ms    49ms  -10.5%    44ms    49ms  -10.7%
             DictWithFloatKeys:    35ms    35ms   -0.5%    35ms    35ms   -1.0%
           DictWithIntegerKeys:    28ms    28ms   -1.2%    28ms    29ms   -2.3%
            DictWithStringKeys:    26ms    27ms   -3.2%    26ms    28ms   -4.8%
        SimpleDictManipulation:    52ms    53ms   -0.7%    53ms    53ms   -0.4%

Hum, as usuall, pybench doesn't seem reliable at all: I expect worse performance with the patch since it adds "version++" in dict.__setimte__(). I don't really trust pybench, results seem to have a lot of noise :-/


Maybe I'm not using pybench correctly? I used:

$ make distclean; ./configure && make
$ ./python Tools/pybench/pybench.py -f pybench.default
$ patch -p1 < dict_version.patch
$ ./python Tools/pybench/pybench.py -f pybench.dictversion
$ ./python Tools/pybench/pybench.py -s pybench.dictversion -c pybench.default


Full output:

-------------------------------------------------------------------------------
PYBENCH 2.1
-------------------------------------------------------------------------------
* using CPython 3.6.0a0 (default:53271aa4d84c+, Jan 9 2016, 10:27:40) [GCC 5.1.1 20150618 (Red Hat 5.1.1-4)]
* disabled garbage collection
* system check interval set to maximum: 2147483647
* using timer: time.perf_counter
* timer: resolution=1e-09, implementation=clock_gettime(CLOCK_MONOTONIC)

-------------------------------------------------------------------------------
Benchmark: pybench.dictversion
-------------------------------------------------------------------------------

    Rounds: 10
    Warp:   10
    Timer:  time.perf_counter

    Machine Details:
       Platform ID:    Linux-4.2.5-300.fc23.x86_64-x86_64-with-fedora-23-Twenty_Three
       Processor:      x86_64
    
    Python:
       Implementation: CPython
       Executable:     /home/haypo/prog/python/default/python
       Version:        3.6.0a0
       Compiler:       GCC 5.1.1 20150618 (Red Hat 5.1.1-4)
       Bits:           64bit
       Build:          Jan  9 2016 10:27:40 (#default:53271aa4d84c+)
       Unicode:        UCS4


-------------------------------------------------------------------------------
Comparing with: pybench.default
-------------------------------------------------------------------------------

    Rounds: 10
    Warp:   10
    Timer:  time.perf_counter

    Machine Details:
       Platform ID:    Linux-4.2.5-300.fc23.x86_64-x86_64-with-fedora-23-Twenty_Three
       Processor:      x86_64
    
    Python:
       Implementation: CPython
       Executable:     /home/haypo/prog/python/default/python
       Version:        3.6.0a0
       Compiler:       GCC 5.1.1 20150618 (Red Hat 5.1.1-4)
       Bits:           64bit
       Build:          Jan  9 2016 10:21:57 (#default:53271aa4d84c)
       Unicode:        UCS4


Test                             minimum run-time        average  run-time
                                 this    other   diff    this    other   diff
-------------------------------------------------------------------------------
          BuiltinFunctionCalls:    42ms    42ms   +0.1%    43ms    43ms   -0.9%
           BuiltinMethodLookup:    26ms    25ms   +5.7%    26ms    25ms   +5.1%
                 CompareFloats:    27ms    27ms   -0.9%    27ms    28ms   -4.2%
         CompareFloatsIntegers:    60ms    63ms   -3.3%    61ms    65ms   -6.8%
               CompareIntegers:    41ms    38ms   +7.9%    41ms    38ms   +7.2%
        CompareInternedStrings:    30ms    28ms   +5.7%    30ms    28ms   +5.0%
                  CompareLongs:    24ms    22ms   +8.6%    24ms    22ms   +8.5%
                CompareStrings:    22ms    22ms   +0.3%    23ms    24ms   -6.6%
    ComplexPythonFunctionCalls:    43ms    42ms   +1.2%    43ms    45ms   -5.2%
                 ConcatStrings:    29ms    32ms  -11.0%    29ms    33ms  -13.6%
               CreateInstances:    45ms    45ms   +0.3%    46ms    46ms   -0.4%
            CreateNewInstances:    34ms    34ms   +0.6%    35ms    34ms   +0.7%
       CreateStringsWithConcat:    58ms    58ms   +0.1%    58ms    58ms   -0.1%
                  DictCreation:    44ms    49ms  -10.5%    44ms    49ms  -10.7%
             DictWithFloatKeys:    35ms    35ms   -0.5%    35ms    35ms   -1.0%
           DictWithIntegerKeys:    28ms    28ms   -1.2%    28ms    29ms   -2.3%
            DictWithStringKeys:    26ms    27ms   -3.2%    26ms    28ms   -4.8%
                      ForLoops:    22ms    22ms   +0.4%    22ms    22ms   +0.6%
                    IfThenElse:    34ms    34ms   +0.9%    34ms    34ms   +0.8%
                   ListSlicing:    34ms    34ms   -0.2%    34ms    34ms   -0.1%
                NestedForLoops:    37ms    36ms   +2.1%    37ms    36ms   +2.1%
      NestedListComprehensions:    36ms    35ms   +1.4%    36ms    36ms   +1.8%
          NormalClassAttribute:    75ms    77ms   -2.5%    75ms    77ms   -2.3%
       NormalInstanceAttribute:    37ms    37ms   +2.2%    38ms    37ms   +2.5%
           PythonFunctionCalls:    37ms    36ms   +1.8%    37ms    37ms   +1.6%
             PythonMethodCalls:    50ms    47ms   +5.5%    50ms    48ms   +4.5%
                     Recursion:    61ms    61ms   -0.2%    61ms    62ms   -0.2%
                  SecondImport:    35ms    36ms   -2.9%    35ms    37ms   -3.3%
           SecondPackageImport:    37ms    37ms   -0.3%    37ms    37ms   -0.4%
         SecondSubmoduleImport:    89ms    87ms   +2.1%    90ms    88ms   +1.6%
       SimpleComplexArithmetic:    23ms    23ms   +0.0%    24ms    24ms   -0.1%
        SimpleDictManipulation:    52ms    53ms   -0.7%    53ms    53ms   -0.4%
         SimpleFloatArithmetic:    25ms    25ms   -1.2%    25ms    25ms   -1.0%
      SimpleIntFloatArithmetic:    32ms    32ms   -0.3%    32ms    32ms   -1.1%
       SimpleIntegerArithmetic:    32ms    32ms   -0.6%    32ms    32ms   -0.3%
      SimpleListComprehensions:    29ms    28ms   +2.3%    30ms    29ms   +3.2%
        SimpleListManipulation:    27ms    28ms   -1.3%    28ms    28ms   -1.4%
          SimpleLongArithmetic:    22ms    22ms   +3.6%    23ms    22ms   +4.4%
                    SmallLists:    38ms    38ms   -1.9%    38ms    41ms   -7.0%
                   SmallTuples:    47ms    44ms   +7.8%    47ms    44ms   +7.5%
         SpecialClassAttribute:    75ms    73ms   +2.3%    75ms    73ms   +2.2%
      SpecialInstanceAttribute:    38ms    39ms   -1.8%    38ms    39ms   -2.1%
                StringMappings:    84ms    83ms   +0.8%    84ms    84ms   +0.5%
              StringPredicates:    49ms    49ms   -0.6%    49ms    49ms   -1.0%
                 StringSlicing:    42ms    42ms   +0.8%    42ms    42ms   +0.7%
                     TryExcept:    25ms    25ms   -0.4%    25ms    25ms   -0.8%
                    TryFinally:    31ms    31ms   +1.1%    32ms    31ms   +1.4%
                TryRaiseExcept:    12ms    12ms   -0.8%    12ms    12ms   -1.4%
                  TupleSlicing:    43ms    43ms   +0.1%    43ms    43ms   -0.6%
                   WithFinally:    49ms    50ms   -0.9%    49ms    50ms   -0.9%
               WithRaiseExcept:    39ms    39ms   -0.6%    39ms    40ms   -1.6%
-------------------------------------------------------------------------------
Totals:                          2011ms  2006ms   +0.2%  2025ms  2035ms   -0.5%

(this=pybench.dictversion, other=pybench.default)
History
Date User Action Args
2016-01-09 09:34:12vstinnersetrecipients: + vstinner
2016-01-09 09:34:12vstinnersetmessageid: <1452332052.18.0.384050047213.issue26058@psf.upfronthosting.co.za>
2016-01-09 09:34:12vstinnerlinkissue26058 messages
2016-01-09 09:34:10vstinnercreate