From 6e772f474531770792bf1e6143e38257c38c8cee Mon Sep 17 00:00:00 2001
From: Emiel Bruijntjes
+ How would the native bubblesort function compare to the built-in sort + function of PHP? This - as you will hopefully understand - is not a very + smart question. Bubblesort is an extremely inefficient algorithm, which + should never be user for real sorting. We have only used it here to demonstrate + the performance different between PHP and C++ if you run exactly the same + algorithm in the two languages. +
++ The built-in sort() function of PHP is much faster than bubblesort. It is + based on quicksort, one of the best and most famous sorting algorithms there + is. And on top of that: the built-in sort() function is implemented in C! + Thus, when you compare the example C++ bubblesort function with the built-in + PHP sort() function, you are comparing two native implementations, and of + course quicksort wins over bubblesort big time! +
C++ is faster - much faster - than code in PHP, even for very simple scripts. -- cgit v1.2.3