On Thursday, June 26, 2003, at 04:09 AM, Sebastian Bergmann wrote:

  I started working on a PHP Micro-Benchmark-Suite [1] to track
  changes in performance between PHP releases.

Great idea.


I was reading this article this morning:

http://www.macdevcenter.com/pub/a/mac/2003/06/24/wwdc_2003.html

"Safari is the shining example of how to do it right. The engineering team made performance the most important feature, and it was measured constantly. No regression was allowed from build to build. If an engineer wanted to introduce a feature that degraded performance, then there had to find some other way to improve speed in order to keep the feature."

For what its worth, I'd like to contribute some of the php benchmarks that I've put together in the past:

http://www.procata.com/php/bench.tgz

These benchmarks mostly test PHP parsing speed and various methods of importing/modifying large amounts of text/html data into a PHP script.

A couple interesting things in here:

I was mildly surprised at how long it takes php to parse raw html with no php escape tags in it.

I would have thought that parsing inside quotes would be more comparable. (look at cb1 vs. qb1 - they should be equal?).

Also, heredoc syntax is 5 times slower than single or double quotes.

I am a little disappointed that include_once performance is so much poorer than the if...defined...include logic is was designed to replace.

Also, I am using ab instead of in-script timers.

Here are my results on a 300 Mhz G3 running Mac OS X & PHP 4.3.2:

ce0 (empty html file)            3.08 [ms]
c1e (empty PHP file)             9.93 [ms]

cb0 (big html)                   5.14 [ms]
cb1 (big html as php)            22.45 [ms]
cb3 (big html as shtml)          15.17 [ms]

ib1  (fread)                     15.75 [ms]
ib2  (include)                   25.40 [ms]

ib3  (include_once)              25.54 [ms]
ib4  (include_once twice)        27.80 [ms]
ib5  (get_file_contents)         15.08 [ms]
ib6  (./include)                 25.32 [ms]

is1  (fread)                     13.06 [ms]
is2  (include)                   13.23 [ms]

qb1 (single quote syntax)        31.94 [ms]
qb2 (double quote syntax)        32.00 [ms]
qb3 (heredoc syntax)             162.22 [ms

rb1  (replace_string)            38.69 [ms]
rb2  (php escape)                26.64 [ms]
rs1  (replace_string)            14.25 [ms]
rs2  (php escape)                14.19 [ms]

rb3 (keys/values rep_str) 33.98 [ms]

Benchmarks marked with an "e" operate on a 0 byte file. Benchmarks marked with an "s" operate on a 366 byte file. Benchmarks marked with a "b" operate on a 35,913 byte file.


-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to