From ba994c3c34e3bc48d79d8bd65d5aed775a48f37a Mon Sep 17 00:00:00 2001 From: Emiel Bruijntjes Date: Tue, 11 Mar 2014 21:05:12 +0100 Subject: updated stupid question over the bubblesort example --- documentation/bubblesort.html | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/documentation/bubblesort.html b/documentation/bubblesort.html index fe5d6b5..c69c0e0 100644 --- a/documentation/bubblesort.html +++ b/documentation/bubblesort.html @@ -173,13 +173,13 @@ Native: 0.79793095588684 seconds Scripted: 8.9202060699463 seconds

-

And now a stupid question

+

And now a silly question

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 + the performance difference between PHP and C++ if you run exactly the same algorithm in the two languages.

@@ -187,8 +187,9 @@ Scripted: 8.9202060699463 seconds 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! + PHP sort() function, you are comparing two native implementations, and not + the performance difference between PHP with C++. And of these native sorting algorithms, + quicksort wins big time!

Summary

-- cgit v1.2.3