function BubbleSort($str)
{
for ($i=0;$i<count($str);$i++)
{
for ($j=count($str)-2;$j>=$i;$j–)
{
if($str[$j+1]<$str[$j])
{
$tmp = $str[$j+1];
$str[$j+1]=$str[$j];
$str[$j]=$tmp;
}
}
}
return $str;
}
for($i = 0;$i < 10000;$i++)
{
$str[$i] = rand(0,20000);
}
BubbleSort($str);
echo “finished”;
?>
running hphp…
creating temporary directory /tmp/hphp_4DOImV …
parsing inputs…
parsing ./random.php…
parsing inputs took 0`00″ (2 ms) wall time
pre-optimizing…
pre-optimizing took 0`00″ (0 ms) wall time
inferring types…
inferring types took 0`00″ (0 ms) wall time
post-optimizing…
post-optimizing took 0`00″ (0 ms) wall time
creating CPP files…
creating CPP files took 0`00″ (35 ms) wall time
compiling and linking CPP files…
compiling and linking CPP files took 0`35″ (35732 ms) wall time
running executable /tmp/hphp_4DOImV/program –file random.php…
finishedall files saved in /tmp/hphp_4DOImV …
running hphp took 0`42″ (42126 ms) wall time
finished
real 0m14.776s
user 0m14.737s
sys 0m0.024s
[root@localhost scribe]# time php random.php
finished
real 0m14.801s
user 0m14.744s
sys 0m0.047s
[root@localhost scribe]# time php random.php
finished
real 0m14.787s
user 0m14.734s
sys 0m0.037s
CMakeCache.txt CMakeFiles cmake_install.cmake CMakeLists.txt Makefile php program sys
[root@localhost hphp_4DOImV]# time ./program
finished
real 0m6.562s
user 0m6.471s
sys 0m0.068s
[root@localhost hphp_4DOImV]# time ./program
finished
real 0m6.100s
user 0m6.067s
sys 0m0.012s
[root@localhost hphp_4DOImV]# time ./program
finished
real 0m6.107s
user 0m6.060s
sys 0m0.027s
Usage:
./program [-m <mode>] [<options>] [<arg1>] [<arg2>] …
Options:
–help display this message
-m [ –mode ] arg (=run) run | server | daemon | replay | translate
-c [ –config ] arg load specified config file
-v [ –config-value ] arg individual configuration string in a format
of name=value, where name can be any valid
configuration for a config file
-p [ –port ] arg (=-1) start an HTTP server at specified port
–admin-port arg (=-1) start admin listerner at specified port
-u [ –user ] arg run server under this user account
-f [ –file ] arg executing specified file
–count arg (=1) how many times to repeat execution
–no-safe-access-check arg (=0) whether to ignore safe file access check
–arg arg arguments
–extra-header arg extra-header to add to log lines
–build-id arg unique identifier of compiled server code
loading static content…
loading static content took 0`00″ (0 ms) wall time
page server started
admin server started
all servers started
HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
Date: Mon, 13 Aug 2012 10:39:09 GMT
Content-Length: 8
finished