A "quick" microbenchmark update PHP 5.4
This is a follow up to A "quick" microbenchmark... you may want to go and read that first.
With the release of PHP 5.4 being toted as a "significant performance improvement" I thought it might be fun to go back and run the quicksort benchmark against the new release. I upgraded to 5.4.3 on my local machine and ran the tests.
|Language||Version||Time in milliseconds|
|1||C++||MS 16.00.30319.01 for 80x86||75|
|2||C# Array.Sort()||.NET 3.5||100|
|4||Groovy api (aka java)||1.8.5||110|
|10||Ruby api array.sort!||1.9.2p290||250|
|14||Node.js (v8) api sort()||0.6.7||480|
|16||Python api sort()||3.1.3||814|
|17||PHP api sort()||5.3.8||1441|
|18||PHP api sort()||5.4.3||1516|
Performance improvement? Yes!
The PHP api version was the same as expected. I didn't look at the source but I would not have expected the sort algorthim to have been changed. As you can see though, the implemented version was "significantly" faster as promised... a whopping 45% faster! That is quite the improvement indeed. There are some other breaking compatibility changes though to be aware of. Anyone still relying on
magic_quotes please step forward !!
As before you can view the code for each implementation on github.