Message227308
Here is another little optimisation that removes the redundant property lookups for the denominator in __add__() and __sub__().
New profile:
5291182 function calls (5290800 primitive calls) in 3.596 seconds
Ordered by: internal time
ncalls tottime percall cumtime percall filename:lineno(function)
519632 0.843 0.000 0.843 0.000 fractions.py:17(gcd)
519644 0.800 0.000 1.709 0.000 fractions.py:73(__new__)
319744 0.520 0.000 1.816 0.000 fractions.py:408(_add)
4 0.401 0.100 3.582 0.896 bm_telco_fractions.py:38(run)
519616 0.291 0.000 3.156 0.000 fractions.py:381(forward)
199872 0.274 0.000 0.904 0.000 fractions.py:424(_mul)
520257 0.145 0.000 0.145 0.000 {built-in method isinstance}
959232 0.108 0.000 0.108 0.000 fractions.py:285(denominator)
959232 0.108 0.000 0.108 0.000 fractions.py:281(numerator)
519657 0.066 0.000 0.066 0.000 {built-in method __new__ of type object at 0x9d1c40} |
|
Date |
User |
Action |
Args |
2014-09-22 21:11:45 | scoder | set | recipients:
+ scoder, mark.dickinson, serhiy.storchaka |
2014-09-22 21:11:45 | scoder | set | messageid: <1411420305.84.0.0186675796744.issue22464@psf.upfronthosting.co.za> |
2014-09-22 21:11:45 | scoder | link | issue22464 messages |
2014-09-22 21:11:45 | scoder | create | |
|