Skip to content

Commit

Permalink
TEST-#2694: add head benchmark (#2696)
Browse files Browse the repository at this point in the history
* TEST-#2694: add head benchmark

Signed-off-by: Anatoly Myachev <anatoly.myachev@intel.com>

* TEST-#2694: add small number for head op

Signed-off-by: Anatoly Myachev <anatoly.myachev@intel.com>
  • Loading branch information
anmyachev authored Feb 8, 2021
1 parent c637d89 commit b93b879
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions asv_bench/benchmarks/benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,25 @@ def time_drop(self, shape, axis, drop_ncols):
execute(self.df.drop(self.labels, axis))


class TimeHead:
param_names = ["shape", "head_count"]
params = [
UNARY_OP_DATA_SIZE[ASV_DATASET_SIZE],
[5, 0.8],
]

def setup(self, shape, head_count):
self.df = generate_dataframe(ASV_USE_IMPL, "int", *shape, RAND_LOW, RAND_HIGH)
self.head_count = (
int(head_count * len(self.df.index))
if isinstance(head_count, float)
else head_count
)

def time_head(self, shape, head_count):
execute(self.df.head(self.head_count))


class TimeFillna:
param_names = ["shape", "limit", "inplace"]
params = [UNARY_OP_DATA_SIZE[ASV_DATASET_SIZE], [None, 0.8], [False, True]]
Expand Down

0 comments on commit b93b879

Please sign in to comment.