[issue1682] Move Demo/classes/Rat.py to Lib/fractions.py and fix it up.

Jeffrey Yasskin report at bugs.python.org
Thu Feb 14 08:21:59 CET 2008


Jeffrey Yasskin added the comment:

r60785 speeds the benchmark up from 10.536s to 4.910s (on top of
whatever my __instancecheck__ fix did). Here are the remaining
interesting-looking calls:

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
...
        1    0.207    0.207    4.999    4.999 {sum}
   199996    1.587    0.000    3.419    0.000 fractions.py:58(__new__)
    99997    0.170    0.000    3.236    0.000 fractions.py:295(forward)
    99998    0.641    0.000    2.881    0.000 fractions.py:322(_add)
    99999    0.202    0.000    1.556    0.000 benchmark.py:3(<genexpr>)
   199996    0.829    0.000    0.829    0.000 fractions.py:17(gcd)
   199996    0.477    0.000    0.757    0.000 abc.py:63(__new__)
   399993    0.246    0.000    0.246    0.000 abc.py:164(__instancecheck__)
   199996    0.207    0.000    0.207    0.000 {method 'get' of
'dictproxy' objects}
   100071    0.185    0.000    0.185    0.000 {isinstance}
   399990    0.109    0.000    0.109    0.000 fractions.py:200(denominator)
   200004    0.073    0.000    0.073    0.000 {built-in method __new__
of type object at 0xfeea0}
   199995    0.065    0.000    0.065    0.000 fractions.py:196(numerator)

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1682>
__________________________________


More information about the Python-bugs-list mailing list