[cfe-dev] error with lambda function that results in endless loop
Ran Regev
Ran.Regev at ecitele.com
Thu May 3 08:13:42 PDT 2012
Thank you all for the insights!
Learnt a lot.
Ran.
-----Original Message-----
From: Jean-Daniel Dupas [mailto:devlists at shadowlab.org]
Sent: Thursday, May 03, 2012 3:55 PM
To: Florian Pflug
Cc: Ran Regev; cfe-dev Developers
Subject: Re: [cfe-dev] error with lambda function that results in endless loop
Le 3 mai 2012 à 13:19, Florian Pflug a écrit :
> On May3, 2012, at 11:53 , Ran Regev wrote:
>> Surly returning true regardless of the value of the elements has no
>> real meaning and can results in nonsense like a1<a2==true && a2<a1==true And surly this is a bad idea to write code like this, but still - why it passes 30 and not 31?
>
> Optimized sort implementations usually choose which algorithm to use based on the input length. This is done because the setup overhead of more sophisticated algorithms are often large enough to cause a net loss in performance for small inputs. In other words, a O(n*log(n)) algorithm may turn out to be slower than a O(n*n) algorithm if the former has a larger setup cost then the latter, and n is small.
>
> best regards,
> Florian Pflug
According to the following presentation, libc++ is able to detect 8 different patterns when it sort a list:
http://llvm.org/devmtg/2010-11/Hinnant-libcxx.pdf
-- Jean-Daniel
This e-mail message is intended for the recipient only and contains information which is CONFIDENTIAL and which may be proprietary to ECI Telecom. If you have received this transmission in error, please inform us by e-mail, phone or fax, and then delete the original and all copies thereof.
More information about the cfe-dev
mailing list