Xinok Sort Update

Timon Gehr timon.gehr at gmx.ch
Sat Oct 29 15:56:23 PDT 2011


On 10/30/2011 12:19 AM, Xinok wrote:
> On 10/29/2011 5:53 PM, Timon Gehr wrote:
>>
>> Looks good =). Thank you. How does this implementation of your algorithm
>> compare to the the unstable sort that is currently in Phobos,
>> performance wise?
>
> I posted some benchmarks here. These benchmarks used the specialized
> code for arrays. There would likely be a larger gap when using ranges.
> https://sourceforge.net/p/xinoksort/blog/2011/10/another-update--benchmarks/
>

Ok, very nice.

>
>> One comment:
>>
>> while(temp is null){
>> try temp.length = len;
>> catch(Exception err){ // Reduce memory usage and try again
>> len /= 2;
>> if(len >= 8) continue;
>> else throw err;
>> }
>> }
>>
>> temp.length = len cannot throw an Exception.
>> I think you are trying to catch an OutOfMemoryError here?
>
> Yes I was. What should I do/use instead?

You could use catch(Error err) or catch(OutOfMemoryError err) or not 
catch the Error at all.


More information about the Digitalmars-d-announce mailing list