"Peter" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> You mention that you could have written the PHP code in a more efficient
way
> using continue(). Why not time this as surely a built in function would be
> quicker than one written in the code.
>
-- snip to
You mention that you could have written the PHP code in a more efficient way
using continue(). Why not time this as surely a built in function would be
quicker than one written in the code.
"Daniel Grace" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> This al
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] (Daniel Grace) wrote:
> Comments? I was expecting the numbers to be very similiar -- rather shocked
> that the PERL ended up being about 2.5x as fast as PHP was.
As Rasmus says, one of the things Perl was designed for was speed. The
Perl designe
Previously, Manuel Lemos wrote:
>
> Your measures do not distinguish between the compile time and execute time.
>
> I don't know about Perl, but since PHP 4, Zend engine first compiles PHP
> code into opcodes and only then it executes the code.
Perl is compiled internally prior to execution.
Hello,
On 05/31/2002 06:36 PM, Daniel Grace wrote:
> The results:
>
> [dewin@ulysses profiling]$ time ./prime.php > /dev/null
>
> real0m14.465s
> user0m8.610s
> sys 0m0.070s
>
> [dewin@ulysses profiling]$ time ./prime.pl > /dev/null
>
> real0m5.302s
> user0m3.180s
> sys
I made an "oops!" when I wrote:
>
> prime.pl:
> #!/usr/bin/perl
> # print "2\n";
> my $num;
> for ($num = 3; $num < 1; $num+=2)
> {
> my $prime = 1;
> for $check ( 2 .. int($num/2) )
> {
> if ($num % $check == 0)
> {
>
6 matches
Mail list logo