[Python-checkins] r67671 - python/branches/py3k-issue1717/Tools/pybench/Calls.py

Jim Jewett jimjjewett at gmail.com
Tue Dec 9 02:16:45 CET 2008


On Mon, Dec 8, 2008 at 7:04 PM, M.-A. Lemburg <mal at egenix.com> wrote:
> On 2008-12-08 23:05, mark.dickinson wrote:
>> Author: mark.dickinson
>> Date: Mon Dec  8 23:05:12 2008
>> New Revision: 67671
>>
>> Log:
>> Remove cmp from pybench
>
> Instead of just removing this part of the test, please replace the
> function with a reasonable new one that takes 2 arguments and
> spends more time parsing arguments than working on them.


Do you mean something like:

    def f2(a, b): pass

or something that can't be completely optimized away, like:

    def f2(a, b): return a+b

> Since range() returns an iterator in Py3, we'll also need
> to change that function in the test.

Why?  I see that it is doing less work, so the numbers won't be
directly comparable to Py2, but it is still a builtin function, and
results should be comparable within the same test version.

-jJ





>> Modified:
>>    python/branches/py3k-issue1717/Tools/pybench/Calls.py
>>
>> Modified: python/branches/py3k-issue1717/Tools/pybench/Calls.py
>> ==============================================================================
>> --- python/branches/py3k-issue1717/Tools/pybench/Calls.py     (original)
>> +++ python/branches/py3k-issue1717/Tools/pybench/Calls.py     Mon Dec  8 23:05:12 2008
>> @@ -178,7 +178,6 @@
>>          # localize functions
>>          f0 = globals
>>          f1 = hash
>> -        f2 = cmp
>>          f3 = range
>>
>>          # do calls
>> @@ -191,11 +190,6 @@
>>              f1(i)
>>              f1(i)
>>              f1(i)
>> -            f2(1,2)
>> -            f2(1,2)
>> -            f2(1,2)
>> -            f2(1,2)
>> -            f2(1,2)
>>              f3(1,3,2)
>>              f3(1,3,2)
>>              f3(1,3,2)
>> @@ -209,11 +203,6 @@
>>              f1(i)
>>              f1(i)
>>              f1(i)
>> -            f2(1,2)
>> -            f2(1,2)
>> -            f2(1,2)
>> -            f2(1,2)
>> -            f2(1,2)
>>              f3(1,3,2)
>>              f3(1,3,2)
>>              f3(1,3,2)
>> @@ -227,11 +216,6 @@
>>              f1(i)
>>              f1(i)
>>              f1(i)
>> -            f2(1,2)
>> -            f2(1,2)
>> -            f2(1,2)
>> -            f2(1,2)
>> -            f2(1,2)
>>              f3(1,3,2)
>>              f3(1,3,2)
>>              f3(1,3,2)
>> @@ -245,11 +229,6 @@
>>              f1(i)
>>              f1(i)
>>              f1(i)
>> -            f2(1,2)
>> -            f2(1,2)
>> -            f2(1,2)
>> -            f2(1,2)
>> -            f2(1,2)
>>              f3(1,3,2)
>>              f3(1,3,2)
>>              f3(1,3,2)
>> @@ -263,11 +242,6 @@
>>              f1(i)
>>              f1(i)
>>              f1(i)
>> -            f2(1,2)
>> -            f2(1,2)
>> -            f2(1,2)
>> -            f2(1,2)
>> -            f2(1,2)
>>              f3(1,3,2)
>>              f3(1,3,2)
>>              f3(1,3,2)
>>


More information about the Python-checkins mailing list