Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

moritz-gross
Copy link
Contributor

This pull request follows up on the previous accepted pull request for numeric inplace sorting. Here we bring Powersort for numeric argsort as well.

On the same sample data as before, we analyzed the improvement of Powersort over Timsort, both for the existing inplace-sorting as well as for argsort. The improvement for argsort is slightly weaker but more concentrated. Slow instances show the biggest change: for the biggest quartile, Timsort on average is 10.7% slower for inplace sorting and 5.7% for argsorting.

For both Timsort and Powersort, argsort is consistently slower than inplace-sorting, by an average factor of 1.80 and 1.84 respectively. This behavior was also already suggested in the review to the last pull request. It is also a likely explanation for the weaker yet more concentrated improvement, as the merge order has less share of the overall computation due to the additional level of indirection.

image

@jorenham
Copy link
Member

What data did you use to test this?

@charris charris merged commit 043ce77 into numpy:main Sep 15, 2025
78 checks passed
@charris
Copy link
Member

charris commented Sep 15, 2025

Thanks @moritz-gross .

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

Successfully merging this pull request may close these issues.

3 participants