Each benchmark has been compiled as a standalone program using the
Roadsend Compiler's optimize switch (-O), and compared against the
same benchmark when run with PHP 4.4.2. The times are in seconds.
They have been averaged over 25 runs. The test machine is an AMD
Athlon XP2800+ running linux 2.6.9
Many of these benchmarks are derived from the benchmarks used in
Doug Bagley's Computer Language Shootout
| File | Open Source PHP
Time | Roadsend Compiler Time | Analysis |
| ackermann.php |
2.14390632
| 0.44623708
| -1.698 20.0% | (4.804X faster)
|
|
This benchmark calculates Ackermann's function with m=3 and n=7. It's a heavy-duty test of recursion and math performance.
|
| ary.php |
0.41623968
| 0.30529236
| -0.111 73.0% | (1.363X faster)
|
|
A simple test of for loops and arrays, this time with slightly larger arrays.
|
| ary2.php |
0.34950984
| 0.27863312
| -0.071 79.0% | (1.254X faster)
|
|
A much simpler test of for loops and arrays.
|
| ary3.php |
1.16184992
| 0.77451176
| -0.387 66.0% | (1.500X faster)
|
|
This is a test of for loops and arrays, with numeric indices.
|
| fibo.php |
3.39937468
| 1.6615196
| -1.738 48.0% | (2.045X faster)
|
|
This is a very simple version of the fibonacci function. It calculates the first 30 fibonacci numbers using recursive procedure calls.
|
| gabriel-stak.php |
0.2372134
| 0.08953816
| -0.148 37.0% | (2.649X faster)
|
|
The Takeuchi function. This version relies on global variables to pass data around.
|
| gabriel-tak.php |
0.144719
| 0.0401796
| -0.105 27.0% | (3.601X faster)
|
|
This is a variant of the Takeuchi function, which is very function call heavy. This version tests recursive function calls.
|
| globals.php |
3.45272992
| 3.12323468
| -0.329 90.0% | (1.105X faster)
|
|
This emphasizes access to global variables via the $GLOBALS array.
|
| globals1.php |
2.08495996
| 0.61904348
| -1.466 29.0% | (3.368X faster)
|
|
This is a straightforward test of global variable access times.
|
| hash2.php |
1.83142272
| 0.8553058
| -0.976 46.0% | (2.141X faster)
|
|
This benchmark exercises associative arrays and foreach loops.
|
| heapsort.php |
0.52736712
| 0.35281564
| -0.175 66.0% | (1.494X faster)
|
|
The benchmark does a heapsort of a large pile of random numbers. It demonstrates performance on slightly more complicated algorithms.
|
| julia-ppm.php |
3.36258696
| 1.4853134
| -1.877 44.0% | (2.263X faster)
|
|
Julia-PPM produces a Julia set fractal in the PPM image format. The output is quite pretty. It represents complex numbers using PHP arrays. It depends heavily on memory management (object copying) performance.
|
| matrix.php |
1.57392088
| 0.78087108
| -0.793 49.0% | (2.015X faster)
|
|
Matrix.php multiplies matrices together using single-dimensional arrays to represent the matrices.
|
| matrix2.php |
1.5825434
| 0.76744216
| -0.815 48.0% | (2.062X faster)
|
|
Matrix2.php also multiplies matrices together. The matrices are represented as 2 dimensional arrays, so this is also a good test of array performance.
|
| mysql.php |
0.93280636
| 0.49909352
| -0.434 53.0% | (1.869X faster)
|
|
This is a benchmark that gets data from a MySQL database and prints it in HTML.
|
| mysql2.php |
0.87043528
| 0.4214328
| -0.449 48.0% | (2.065X faster)
|
|
This is a test of the mysql_query() and mysql_fetch_array() functions, and printing results in HTML.
|
| nestedloop.php |
0.69234332
| 0.27445652
| -0.418 39.0% | (2.522X faster)
|
|
This is another benchmark for loops. Three loops are nested inside each other.
|
| num-test.php |
0.80799292
| 0.3001288
| -0.508 37.0% | (2.692X faster)
|
|
This is a simple test of looping, addition, and multiplication.
|
| objects.php |
13.41442768
| 6.44139148
| -6.973 48.0% | (2.082X faster)
|
|
This is an in-depth benchmark of the PHP object system.
|
| random.php |
2.73136204
| 1.3588268
| -0.602 78.0% | (1.278X faster)
|
|
This test generates 1 million random numbers.
|
| reversefile.php |
1.10595988
| 0.7371578
| -0.369 66.0% | (1.500X faster)
|
|
The reversefile benchmark uses array_push() and array_reverse() to reverse a file.
|
| sieve.php |
0.71153888
| 0.58618068
| -0.125 82.0% | (1.213X faster)
|
|
This benchmark is a test of looping, arithmetic, and array speed.
|
| strcat.php |
4.36742168
| 0.04881764
| -4.319 1.0% | (89.46X faster)
|
|
This benchmark appends a few words onto the end of a string 10000 times, using both the .= operator and the = operator.
|
| xmlparse.php |
0.1100406
| 0.1176006
| +0.008 106.0% | (1.068X slower)
|
|
The xmlparse benchmark uses the xml_parse() function to parse 2 different XML files 20 times each, using methods as callbacks.
|