Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stable sort #769

Closed
graingert opened this issue Feb 16, 2020 · 1 comment
Closed

stable sort #769

graingert opened this issue Feb 16, 2020 · 1 comment

Comments

@graingert
Copy link
Contributor

tc39/ecma262#1340

@zloirock
Copy link
Owner

I'm thinking about it, but I'm still not 100% sure.

Feature detection of stable sort requires sorting of arrays and typed arrays (both) with more than 512 elements - many engines use unstable sorting only with arrays larger. Since complexity can be O(n^2), it's up to 513 * 513 * 2 iterations on feature detection - some additional milliseconds on core-js loading. Sure, we can detect browser version by UA, but it's not something ultimate.

Which sorting algorithm could be better for implementation? I don't think that something complex is required for obsolete engines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants