Page 1 of 1

Testing PHP 5.2.6 vs ASP 3.0

Posted: Sat Nov 15, 2008 1:34 pm
by kanenas.net
The machine: Intel Core 2 Duo Processor 1.8GHz, 2GB RAM
OS: Microsoft Vista Home Premium, IIS 7.0
Scripting Languages: PHP 5.2.6, ASP 3.0
Senario: Test a loop to see the time results...

Here is the ASP code...

Code: Select all

 
<%
Dim i, st
 
st=Now()
 
For i=0 To 50000000
Next
 
response.write st & "<br />"
response.write Now()
%>
 
Here is the PHP code...

Code: Select all

 
<?php
set_time_limit(150);
 
$st=date("H:i:s");
 
for ($i=0; $i<=50000000; $i++) {
}
 
echo $st . "<br />";
echo date("H:i:s");
?>
 
Results...

Code: Select all

 
[b]Loop[/b]                  [b]PHP Start[/b]         [b]PHP End[/b]                [b]ASP Start[/b]                       [b]ASP End[/b]
0-50.000.000          19:42:42          19:42:47            15/11/2008 7:43:07 ??          15/11/2008 7:43:10 ??
0-100.000.000         19:45:38          19:45:49            15/11/2008 7:45:29 ??          15/11/2008 7:45:35 ??
0-1.000.000.000       19:48:46          19:50:39            15/11/2008 7:47:21 ??          15/11/2008 7:48:18 ??
 
Is it because of Windows IIS 7.0?
I haven't tried the PHP script with Apache!

Any comments ?

Re: Testing PHP 5.2.6 vs ASP 3.0

Posted: Mon Nov 17, 2008 12:21 am
by XaeroDegreaz
The ASP code is running on it's native platform, so of course it will be faster :)

Try running PHP with the Zend Platform ;)

Re: Testing PHP 5.2.6 vs ASP 3.0

Posted: Sat Nov 22, 2008 6:06 pm
by josh
Next time I have to write an infinite loop Im definitely using ASP

Re: Testing PHP 5.2.6 vs ASP 3.0

Posted: Fri Dec 05, 2008 11:20 pm
by JAB Creations
jshpro2 wrote:Next time I have to write an infinite loop Im definitely using ASP
Yeah, wouldn't want to give the client enough time to hit the escape button! :twisted: