-
Notifications
You must be signed in to change notification settings - Fork 52
Open
Description
In xp.sort
and xp.argsort
, the sort is stable by default.
I understand very well the interest for argsort: I've seen a lot of bugs because people expected np.argsort
to be stable.
And I guess sort is stable by default to match argsort behavior. But:
- stable sort is slower. Typically, 8x slower in numpy on my machine.
- for totally ordered data types, stable sort output is indistinguable from unstable sort output
- for complex numbers the doc says:
For backward compatibility, conforming implementations may support complex numbers; however, inequality comparison of complex numbers is unspecified and thus implementation-dependent
So: are we sure it's a good idea to default to stable sort?
Alternatively: shouldn't we call unstable sort under-the-hood for non-complex numbers, even when stable=True
?
Metadata
Metadata
Assignees
Labels
No labels