Micro-benchmarking Phalanger version 2.0 Beta 2

Microbenchmarks

Each operation performed 10M times in a loop; machine: Pentium M Dothan 1.8GHz/2MB cache

Performance of Phalanger compiled phpBB application

We've compared performance of phpBB 2.0.14 message board system running on Phalanger 1.0 Beta 3, PHP 4.3.11, and PHP 5.0.4 with and without Zend Optimizer. We've also tested MySQL 4.1.11 and MSDE 2000 SP3 personal databases. The measurement has been performed by Microsoft Application Center Test on an Intel Pentium M 1.4 GHz machine with 1 GB RAM running Windows XP Professional SP2 and IIS 5.1 web server. The results are shown in the following figure.

Benchmarking phpBB

We've tested three Phalanger configurations:
  1. managed MSSQL extension (equivalent of PHP MSSQL extension rewritten in C#),
  2. native MSSQL extension shipped with PHP running in the same address space as the web server (collocated),
  3. native MSSQL extension shipped with PHP running in the separate process (isolated),

and four PHP configurations.

Unsurprisingly, the Phalanger is fastest when using the managed MSSQL extension. Particularly, 2.5-times faster in comparison with PHP 4.3.11 and 1.7-times faster in comparison with PHP 4.3.11 sped-up by the Zend Optimizer. In Phalanger, managed extensions are faster than native ones because no managed-to-native data conversions take place. On the other hand, the interprocess communication with an isolated native extension is quite expensive. That's why the configuration using the isolated extension is the slowest one. We haven't implemented managed MySQL extension yet, so there are only two configurations tested against MySQL database. As we can see, either with native extension the Phalanger outperforms any PHP configuration we've tested.


The following charts compares the Phalanger with the PHP interpreter and the interpreter enhanced by Zend Performance Suite. The performance of web applications has been measured by the Microsoft Web Application Stress Tool. The vertical axis then displays average number of served requests per second.

Performance of Phalanger compiled PHP database intensive web application (PHP-Nuke)

A complex database-intensive portal system, PHP-Nuke, is tested in the first benchmark. Number of requests served by Phalanger with a managed implementation of MSSQL database extension is nearly double when compared to the most powerful Windows PHP configuration. The second and third columns refer to the situation, in which database access is provided by the original native MSSQL extension wrapped by the managed wrapper. It is apparent that running the extension in isolated mode brings substantial overhead caused by the interprocess communication.

Benchmarking PHP Nuke

Performance of Phalanger compiled PHP web application without database access

Using a sample application Luboss from real life containing HTML forms and generated content but without a database access, we compare performance of the compiled code versus the interpreted and encoded once. We also tried to compare performance with the Roadsend Compiler but it failed to compile the testing application.

Benchmarking Luboss Accomodation

Performance of Phalanger compiled PHP code

The graph displays the results of some computation-based benchmarking scripts shipped with the Roadsend Compiler. The horizontal axis represents script execution time in seconds (less values denote better results).


strcat
nestedloop
fibo
ackermann
heapsort
matrix
reversefile
sieve
random
hash
wc
array

The benchmarks were performed on an Intel Pentium M 1.4 GHz machine with 1 GB RAM running Windows XP Professional SP2, IIS 5.1, Apache 1.3.31, PHP 4.3.7 (via ISAPI filter in IIS and module in Apache) and Zend Performance Suite 3.6.