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

From: Petri Laihonen <pietu_at_weblizards.net>
Date: Thu, 1 Jul 2004 08:15:25 -0500 (CDT)
Message-ID: <1684.68.14.52.165.1088687725.squirrel@secure.weblizards.net>

> On Wed, 2004-06-30 at 22:18 -0500, Petri Laihonen wrote:
>> > On Wed, 2004-06-30 at 17:54 -0500, Petri Laihonen wrote:
>> >> >> It took about 15 minutes on my Athlon(tm) XP 2200+. Shoulda
>> >> >> timed it.
>> >> >
>> >> > I have a P4 1.4 Ghz machine. I was doing a few other things at the
>> >> time
>> >> > too...
>> >> >
>> >> >
>> >> > Wed Jun 30 15:49:54 CDT 2004
>> >> > 903090
>> >> > Wed Jun 30 16:23:23 CDT 2004
>> >> >
>> >> >
>> >> > 33 minutes!
>> >> >
>> >>
>> >> I like this kind of pissing contest where inferior machine beats the
>> >> hell
>> >> out of "superior" machines.
>> >>
>> >> My web server,
>> >> AMD Duron ~ 1Ghz,
>> >> while handling all the webstuff, emails, database etc.... for a bit
>> >> under
>> >> 100 domains calculated that same thing in :
>> >>
>> >> Surprise..... 131 seconds. (Roughly under 3 minutes.)
>> >>
>> >> I got the same result
>> >> length: 903090
>> >> time: 131
>> >>
>> >> Except I just used PHP from commandline.
>> >> Could the language used really make that much of a difference?
>> >> If yes, who would use such a slow language???
>> >
>> > Sooo, what command did you use. Please share it with us.
>> >
>>
>> Here it is!
>>
>> <?php
>> $time1 = time();
>> print "start\n";
>> $result = bcpow(2,3000000);
>> $len = strlen($result);
>> $time2 = time();
>> $ctime = $time2 - $time1;
>> //print "result: $result\n";
>> (did not feel like printing all the numbers to the screen)
>> print "length: $len\n";
>> print "time: $ctime\n";
>> ?>
>
> Thanks.
>
> Can that be run from the CLI, or must it be embedded in a web
> page?
>

Yep,

You just make the php script and run from CLI.
$ php myscript.php
or
$ path/to/php myscript.php

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