I am using Apache ab to test one simple file and Zend application.
Zend application page is default page that comes with skeleton application.
And another file is show below:
$start = -microtime(TRUE);
ini_set("max_execution_time", 0);
date_default_timezone_set("Asia/Kolkata");
echo "<pre>";
//echo date("d-M-Y H:i", 1392034673).PHP_EOL;
//echo date("d-M-Y H:i", 1391771666).PHP_EOL;
$string = "abc/{name}/{name}/{message}";
preg_match_all('#{.*}#', $string, $match);
var_dump($match);
echo $url = preg_replace(array('#{name}#', '#{message}#'), array('([a-zA-Z]+)', '([a-zA-Z0-9_-]+)'), str_replace("/", "\\/", $string));
preg_match('#' . $url . '#', "abc/hi/hi/bhavik-is-saying", $matched);
var_dump($matched);
echo "<br/>Process time : " . (microtime(TRUE) + $start);
Benchmark Results
ab -n 50 -c 20 http://local.host/zend/public
Time : 24.600 ms
Request per second : 406.50
ab -n 50 -c 20 http://local.host/test/test.php
Time : 52.600 ms
Request per second : 190.11
Why is test.php behind Zend application even though my test.php have less code compared to Zend application?
preg_*
calls – Elias Van Ootegem Feb 17 '14 at 8:09