RE: [Nolug] In case you wanted to know how big 2 to the 3,000,000 is...

From: Pietu <pietu_at_weblizards.net>
Date: Thu, 1 Jul 2004 14:27:27 -0500
Message-ID: <002401c45fa1$71e2f850$5e50a8c0@avatarlab>

> >Surprise..... 131 seconds. (Roughly under 3 minutes.)
> >
> >I got the same result
> >length: 903090
> >time: 131
> >
>
> I tried it in perl too, but got rather different results.
>
> use Math::BigInt lib=>'GMP';
> print Math::BigInt->new('1')->blsft(3000000, 2)->length() ."\n";
>
> fritz $ time perl test.pl
> 903090
>
> real 0m10.035s
> user 0m8.320s
> sys 0m0.160s
>
> 10 seconds on a 667 Mhz Mac. It is all about how smart your
> algorithm
> is. (Or perhaps Macs are that powerful! ;-) )
>

I believe there is two factors here at least.
1) Motorola cpu is faster with equivalent Mhz than for example intel.
However, with mac's except the very recent ones. The slow bottleneck has
always been the stuff that's surrounding the cpu.
2) the algorithm used for the calculations.

P

___________________
Nolug mailing list
nolug@nolug.org
Received on 07/01/04

This archive was generated by hypermail 2.2.0 : 12/19/08 EST