PHP and VMware: SLOW



Hello.

I'm finding PHP really slow when it runs in VMware.

To test this, I wrote two benchmark scripts. One in perl, one in php
(attached below)
Both scripts call rand() 100000000 times.

On my ancient 1ghz sarge box:
php takes 3 minutes 28 seconds.
perl takes 1 minute 18 seconds.
php = 3 x perl

On my 3 ghz ubuntu 6.06 VMware instance, running php4:
php takes 2 minutes and 37 seconds.
perl takes 23 seconds.
php = 6 x perl

Why is php slower so much slower under VMware?
If anyone could help, I would really appreciate it.

Thanks

::::::::::::::
rand.php
::::::::::::::
<?
for ($j = 0; $j < 100000000; $j++) {
rand();
}
?>

::::::::::::::
rand.pl
::::::::::::::
#!/usr/bin/perl
for ($i=0;$i<100000000;$i++)
{
rand();
}

.



Relevant Pages

  • Re: What are the differences between Perl and PHP when handling with Web pages
    ... What are the differences between Perl and PHP? ... anyway for the sake of good programming practice. ... I end up using PHP more for web development than PHP. ...
    (perl.beginners)
  • Re: Can a Perl Programmer Pick up PHP quickly?
    ... PHP is not easier compared to Perl. ... a language with fewer features is going to be easier to ... You can't call documentation guessed after the source not good ...
    (comp.lang.perl.misc)
  • Re: PHP and VMware: SLOW
    ... php = 3 x perl ... On my 3 ghz ubuntu 6.06 VMware instance, running php4: ... Why is php slower so much slower under VMware? ...
    (php.general)
  • Re: Face lift survey
    ... But PHP, I think, integrates html code a better way. ... you still have to do a perl script and then put ... Perl CGI programming! ...
    (perl.beginners)
  • Re: Coverting perl to php
    ... I am bout ready to convert it to php but wonder if there are ... but there's nothing to match a good perl person porting their ... The reason for the rewrite is because a large chunk of the ancilary ... code to talk to the database, recreating what they did, and having 2 ...
    (comp.lang.php)