Skip to content

ASV: Add merge on categorical benchmarks #45169

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 2 commits into from
Jan 3, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions asv_bench/benchmarks/join_merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,12 +262,24 @@ def setup(self):
Z=self.right_object["Z"].astype("category")
)

self.left_cat_col = self.left_object.astype({"X": "category"})
self.right_cat_col = self.right_object.astype({"X": "category"})

self.left_cat_idx = self.left_cat_col.set_index("X")
self.right_cat_idx = self.right_cat_col.set_index("X")

def time_merge_object(self):
merge(self.left_object, self.right_object, on="X")

def time_merge_cat(self):
merge(self.left_cat, self.right_cat, on="X")

def time_merge_on_cat_col(self):
merge(self.left_cat_col, self.right_cat_col, on="X")

def time_merge_on_cat_idx(self):
merge(self.left_cat_idx, self.right_cat_idx, on="X")


class MergeOrdered:
def setup(self):
Expand Down