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

ASV: used integer ndarray as indexer for Series.take indexing benchmark #36656

Merged
merged 2 commits into from
Oct 2, 2020

Conversation

hardikpnsp
Copy link
Contributor

@hardikpnsp hardikpnsp commented Sep 26, 2020

Series.take was using a list of booleans as indexers. Now, It is replaced with a random list of integers.
Here are the benchmark results with asv run --bench indexing.Take

Benchmarks Results:

Before:

[100.00%] ··· indexing.Take.time_take                                                                                                                                                ok
[100.00%] ··· ========== =============
                index                 
              ---------- -------------
                 int      4.13±0.08ms 
               datetime   4.13±0.01ms 
              ========== =============

After:

[100.00%] ··· indexing.Take.time_take                                                                                                                                                ok
[100.00%] ··· ========== =============
                index                 
              ---------- -------------
                 int      6.36±0.08ms 
               datetime   6.29±0.03ms 
              ========== =============

Copy link
Member

@jorisvandenbossche jorisvandenbossche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this!

@hardikpnsp
Copy link
Contributor Author

Updated benchmarks after changing indexer from list to ndarray:

[100.00%] ··· indexing.Take.time_take                                                                                                                                                ok
[100.00%] ··· ========== =========
                index             
              ---------- ---------
                 int      336±2μs 
               datetime   348±2μs 
              ========== =========

@hardikpnsp hardikpnsp changed the title ASV: used integer list as indexer for Series.take indexing benchmark ASV: used integer ndarray as indexer for Series.take indexing benchmark Sep 27, 2020
@jreback jreback added the Benchmark Performance (ASV) benchmarks label Oct 2, 2020
@jreback jreback added this to the 1.2 milestone Oct 2, 2020
@jreback jreback added the ExtensionArray Extending pandas with custom dtypes or arrays. label Oct 2, 2020
@jreback jreback merged commit b083ef3 into pandas-dev:master Oct 2, 2020
@jreback
Copy link
Contributor

jreback commented Oct 2, 2020

thanks @hardikpnsp

@hardikpnsp hardikpnsp deleted the fix-index-take-benchmark branch October 3, 2020 01:42
kesmit13 pushed a commit to kesmit13/pandas that referenced this pull request Nov 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Benchmark Performance (ASV) benchmarks ExtensionArray Extending pandas with custom dtypes or arrays.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BENCH: Index.take benchmark is measuring wrong thing
3 participants