Comment #50 on issue 90 by [email protected]: V8 doesn't stable sort
https://code.google.com/p/v8/issues/detail?id=90
#48> performance is the disadvantage. As the number of items in the array
grows, stable sorts perform worst and worst for a variety of reasons, from
algorithm complexity to memory usage to cache misses depending on which
specific algorithm you compare and what criteria you focus on.
Now, given:
1) it is possible to get stable results with an unstable sort, using a good
compareFn.
(that's how it should be done anyway, performing several sorts in a row
is inefficient).
2) it is *not* possible to get unstable sort performance with a stable sort.
…then it seems a rather logical choice to provide an unstable sort.
And about developers being surprised… you make a mistake, you realize it,
you fix it, you learn and don't do it again. You don't blame the library
just because you misread the documentation.
“I tried to use a knife to eat soup and cut myself, let's change knives to
they don't cut anymore”. I don't think dumbing down and hampering tools
everytime someone trips on them would do any good in the long run.
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.