Author mark.dickinson
Recipients facundobatista, gvanrossum, jyasskin, mark.dickinson, ncoghlan, rhettinger
Date 2008-02-12.22:15:57
SpamBayes Score 0.492743
Marked as misclassified No
Message-id <1202854559.7.0.323946066269.issue1682@psf.upfronthosting.co.za>
In-reply-to
Content
> BTW I think the next goal should be to reduce the cost of constructing
> a Fraction out of to plain ints by at least an order of magnitude. I
> believe this is possible.

I certainly hope so!  Here's a very simple (and simplistic) benchmark:

# start benchmark

from fractions import Fraction
from cProfile import run

def test1():
    return sum(Fraction(1, n*n-1) for n in xrange(2, 100000))

run("test1()")

#end benchmark

On my MacBook this reports a total time of 38.072 seconds, with 22.731 of 
those (i.e. around 60%) being spent in abc.__instancecheck__ and its 
callees.
History
Date User Action Args
2008-02-12 22:15:59mark.dickinsonsetspambayes_score: 0.492743 -> 0.492743
recipients: + mark.dickinson, gvanrossum, rhettinger, facundobatista, ncoghlan, jyasskin
2008-02-12 22:15:59mark.dickinsonsetspambayes_score: 0.492743 -> 0.492743
messageid: <1202854559.7.0.323946066269.issue1682@psf.upfronthosting.co.za>
2008-02-12 22:15:58mark.dickinsonlinkissue1682 messages
2008-02-12 22:15:57mark.dickinsoncreate