Worst-case performance of quickSort / getPivot

David Nadlinger code at klickverbot.at
Wed Dec 4 07:04:40 PST 2013


On Monday, 18 November 2013 at 05:26:30 UTC, Chris Cain wrote:
> On my computer (`-release -inline -noboundscheck` ... `-O` is 
> omitted because it removes the summation all together since it 
> isn't used anywhere):

The better way to avoid this problem is usually to compile the 
operation to be benchmarked separately, in such a way that the 
result can't be ignored (e.g. by making it read the parameters 
from function arguments and returning the result as the return 
value). Comparing non-optimized (i.e. -O) builds for execution 
speed is of questionable relevance for most cases.

David


More information about the Digitalmars-d mailing list