[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [plt-scheme] Divisions




> I think your timing results include the time it takes Mz/DrScheme to
> convert the numbers from strings to integers. Try this instead:
> 

Maybe...
Check this awesome and unbelievable benchmark...
(I've renamed gcd-ext-ndiv with gcd-ext. Previous gcd-ext is in
trash bin now :)... )

> (define a 4346655768693745643568852767504062580256466051737178040248172908953655541794905189040387984007925516929592259308032263477520968962323987332247116164299644090653318793829896964992851600370447613779516684922887543466557686937456435688527675040625802564660517371780402481729089536555417949051890403879840079255169295922593080322634775209689623239873322471161642996440906533187938298969649928516003704476137795166849228875434665576869374564356885276750406258025646605173717804024817290895365554179490518904038798400792551692959225930803226347752096896232398733224711616429964409065331879382989696499285160037044761377951668492288754346655768693745643568852767504062580256466051737178040248172908953655541794905189040387984007925516929592259308032263477520968962323987332247116164299644090653318793829896964992851600370447613779516684922887543466557686937456435688527675040625802564660517371780402481729089536555417949051890403879840079255169295922593080322634775209689623239873322471161642996440906533187938298969649928516003704476137795166849228875434665576869374564356885276750406258025646605173717804024817290895365554179490518904038798400792551692959225930803226347752096896232398733224711616429964409065331879382989696499285160037044761377951668492288754346655768693745643568852767504062580256466051737178040248172908953655541794905189040387984007925516929592259308032263477520968962323987332247116164299644090653318793829896964992851600370447613779516684922887543466557686937456435688527675040625802564660517371780402481729089536555417949051890403879840079255169295922593080322634775209689623239873322471161642996440906533187938298969649928516003704476137795166849228875234)
> (define b 26863810024485359386146727202142923967616609318986952340123175997617981700247881689338369654483356564191827856161443356312976673642210350324634850410377680367334151172899169723197082763985615764450078474174626268638100244853593861467272021429239676166093189869523401231759976179817002478816893383696544833565641918278561614433563129766736422103503246348504103776803673341511728991697231970827639856157644500784741746262686381002448535938614672720214292396761660931898695234012317599761798170024788168933836965448335656419182785616144335631297667364221035032463485041037768036733415117289916972319708276398561576445007847417462626863810024485359386146727202142923967616609318986952340123175997617981700247881689338369654483356564191827856161443356312976673642210350324634850410377680367334151172899169723197082763985615764450078474174626268638100244853593861467272021429239676166093189869523401231759976179817002478816893383696544833565641918278561614433563129766736422103503246348504103776803673341511728991697231970827639856157644500784741746262686381002448535938614672720214292396761660931898695234012317599761798170024788168933836965448335656419182785616144335631297667364221035032463485041037768036733415117289916972319708276398561576445007847417462626863810024485359386146727202142923967616609318986952340123175997617981700247881689338369654483356564191827856161443356312976673642210350324634850410377680367334151172899169723197082763985615764450078474174626)
> (map benchmark '(gcd ext-gcd))
gcd
cpu time: 210 real time: 208 gc time: 190
ext-gcd
cpu time: 60 real time: 60 gc time: 0
<snip uninteresting results>

This one is strange so I tried another one!
With bigger number I get:
gcd
cpu time: 690 real time: 700 gc time: 580
ext-gcd
cpu time: 5140 real time: 5193 gc time: 4410
<snip uninteresting results>

With much more bigger numbers:
gcd
cpu time: 3270 real time: 3273 gc time: 2410
ext-gcd
cpu time: 32140 real time: 32633 gc time: 26180
<snip uninteresting results>

:) Ok,... The first time, gcd took more than usual... maybe
because it was the first function to be executed... Anyway, do
you think that calling from source GCD-Extended from GMP will
give us better results? 

Best regards,

-- 
Paulo J. Matos : pocm(_at_)rnl.ist.utl.pt
Instituto Superior Tecnico - Lisbon    
Software & Computer Engineering - A.I.
 - > http://www.rnl.ist.utl.pt/~pocm 
 ---	
	Yes, God had a deadline...
		So, He wrote it all in Lisp!