On Tue, Mar 15, 2016 at 8:50 AM, Vic99999 <vic99...@yandex.ru> wrote:
>> What about the Timsort?
>
> I cannot believe it will be faster on random int array. And TimSort is base 
> on MergeSort and, seems, for it's worst cases it cannot be better than 
> MergeSort.
> I have tried https://github.com/mziccard/node-timsort/ with my old node.js - 
> 0.10.4 and Chrome 49 (win32) - and I see that random int array case is much 
> slower that native in Chrome, and in node.js too if I replace "native" with a 
> function from https://github.com/v8/v8/blob/master/src/js/array.js .
>
> Perhaps, implementers will want to leave the behaviour of 
> `array.sort(comparefn)` as it was for backward compatiblity.

There's no back-compat impact for switching to a stable sort; since
you can't depend on the ordering of an unstable sort in the first
place, changing that order (to stable) is fine.  (Most likely it'll
*fix* pages that are currently sometimes broken in small ways because
they assume stability.)  It's just potentially a minor speed drop.

~TJ
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to