Optimizing Java using D

safety0ff via Digitalmars-d digitalmars-d at puremagic.com
Fri Jun 20 19:21:42 PDT 2014


On Saturday, 21 June 2014 at 01:48:20 UTC, Peter Alexander wrote:
> On Saturday, 21 June 2014 at 01:07:20 UTC, safety0ff wrote:
>> std.algorithm.sort with SwapStrategy.unstable is considerably 
>> slower than his, whereas builtin sort is  abysmal.
>>
>> I find that generally using SwapStrategy.stable performs 
>> better.
>> This isn't universal though as there are cases where it is 
>> slower.
>
> wat
>
> Shouldn't unstable be faster, otherwise we might as well just 
> alias unstable = stable!?

Many times my data is the result of mapping sorted/partially 
sorted input to a function which does not randomize order.
This creates many partially sorted runs.

Timsort is used for stable sorting and it was designed for this 
type of input.


More information about the Digitalmars-d mailing list