From 669064400f31dff72d642143cdc70307a836c73f Mon Sep 17 00:00:00 2001 From: Anatoly Myachev Date: Fri, 5 Feb 2021 15:42:43 +0300 Subject: [PATCH] TEST-#2699: add append benchmark Signed-off-by: Anatoly Myachev --- asv_bench/benchmarks/benchmarks.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/asv_bench/benchmarks/benchmarks.py b/asv_bench/benchmarks/benchmarks.py index 78254b98471..83a78bba2d5 100644 --- a/asv_bench/benchmarks/benchmarks.py +++ b/asv_bench/benchmarks/benchmarks.py @@ -225,6 +225,27 @@ def time_concat(self, shapes, how, axis): raise NotImplementedError +class TimeAppend: + param_names = ["shapes", "sort"] + params = [ + BINARY_OP_DATA_SIZE[ASV_DATASET_SIZE], + [False, True], + ] + + def setup(self, shapes, sort): + self.df1 = generate_dataframe( + ASV_USE_IMPL, "int", *shapes[0], RAND_LOW, RAND_HIGH + ) + self.df2 = generate_dataframe( + ASV_USE_IMPL, "int", *shapes[1], RAND_LOW, RAND_HIGH + ) + if sort: + self.df1.columns = self.df1.columns[::-1] + + def time_append(self, shapes, sort): + execute(self.df1.append(self.df2, sort=sort)) + + class TimeBinaryOp: param_names = ["shapes", "binary_op", "axis"] params = [