-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
PERF: Remove unnecessary copies in sorting functions (#33917) #34192
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
Conversation
Hello @mproszewska! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found: There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2020-06-03 01:25:38 UTC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add an asv which hits this. I think this regression is in 1.1 so no whatsnew is needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also in tests where this is hit, can you assert that values is not modified
This is used in function that sorts series by index, so I believe that values=index will be modified |
asv_bench/benchmarks/algorithms.py
Outdated
class SortIndexSeries: | ||
def setup(self): | ||
N = 10 ** 5 | ||
idx = pd.date_range(start="1/1/2000", periods=N, freq="s") | ||
self.s = pd.Series(np.random.randn(N), index=idx) | ||
|
||
def time_sort_index(self): | ||
self.s.sort_index() | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need this. SortIndex.time_sort_index already covers this code path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, I haven't checked timeseries
before adding asv
Can you add a release note stating that we fixed the performance regression in sort_index? |
Should I add note even though regression was in 1.1? |
no this is fine (just add the asvs) |
Isn't |
what does it show pls post a run |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks fine
can u merge master and ping on green
ping |
thanks @mproszewska |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff
This PR fixes pereformance regression after commit
dec736f3f
by removing unnecessary copies ifkey=None
in sorting functions.