Skip to content

Add asv benchmarks for Block.setitem() #53177

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

Merged
merged 8 commits into from
May 15, 2023

Conversation

steliospetrakis02
Copy link
Contributor

I believe that this solves the issue , however let me know if i need to change anything as i am not familliar with asv benchmarks

(np.array(True), "np.array(True)"),
]

def setup(self, true_value):
Copy link
Member

Choose a reason for hiding this comment

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

Could you move this to indexing.py?


def time_test(self, true_value):
"""Test time for assigning a slice `True` and `np.array(True)`"""
tmp_df = self.df.copy()
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't need this copy

@mroeschke mroeschke added the Benchmark Performance (ASV) benchmarks label May 11, 2023
@steliospetrakis02
Copy link
Contributor Author

Thank you for your response @mroeschke . I solved the issues as you told me , if there is anything else i can do let me know.

@mroeschke
Copy link
Member

Looks like the new benchmark is failing, please run it locally to see if it's working correctly https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#running-the-performance-test-suite

@steliospetrakis02
Copy link
Contributor Author

I was able to resolve the issue on my local system. Thank you for your feedback @mroeschke

@steliospetrakis02
Copy link
Contributor Author

@mroeschke moved the import at the start of the file as you told me

@steliospetrakis02
Copy link
Contributor Author

@mroeschke Looks like that the tests have passed now and i also moved the imports as you told me. If there is anything else i can do, please let me know.

@mroeschke mroeschke added this to the 2.1 milestone May 15, 2023
@mroeschke mroeschke merged commit 1a4832b into pandas-dev:main May 15, 2023
@mroeschke
Copy link
Member

Thanks @steliospetrakis02

Rylie-W pushed a commit to Rylie-W/pandas that referenced this pull request May 19, 2023
* Add test for groupby with TimeGrouper

* add asv_bench for block

* add asv_bench for block

* Delete block.py , move class Block to indexing.py , as requested
and delete df.copy

* Add one more parameter to signarures seems to solve the issue

* change name to mode

* Move import to the start of the file
topper-123 pushed a commit to topper-123/pandas that referenced this pull request May 22, 2023
* Add test for groupby with TimeGrouper

* add asv_bench for block

* add asv_bench for block

* Delete block.py , move class Block to indexing.py , as requested
and delete df.copy

* Add one more parameter to signarures seems to solve the issue

* change name to mode

* Move import to the start of the file
Daquisu pushed a commit to Daquisu/pandas that referenced this pull request Jul 8, 2023
* Add test for groupby with TimeGrouper

* add asv_bench for block

* add asv_bench for block

* Delete block.py , move class Block to indexing.py , as requested
and delete df.copy

* Add one more parameter to signarures seems to solve the issue

* change name to mode

* Move import to the start of the file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Benchmark Performance (ASV) benchmarks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extremely Slow Block.setitem() when value is a builtin python type.
2 participants