Skip to content

Commit 7525f05

Browse files
authored
TEST-#2699: add append benchmark (#2700)
Signed-off-by: Anatoly Myachev <[email protected]>
1 parent 3a31683 commit 7525f05

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

asv_bench/benchmarks/benchmarks.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,27 @@ def time_concat(self, shapes, how, axis):
227227
execute(IMPL[ASV_USE_IMPL].concat([self.df1, self.df2], axis=axis, join=how))
228228

229229

230+
class TimeAppend:
231+
param_names = ["shapes", "sort"]
232+
params = [
233+
BINARY_OP_DATA_SIZE[ASV_DATASET_SIZE],
234+
[False, True],
235+
]
236+
237+
def setup(self, shapes, sort):
238+
self.df1 = generate_dataframe(
239+
ASV_USE_IMPL, "int", *shapes[0], RAND_LOW, RAND_HIGH
240+
)
241+
self.df2 = generate_dataframe(
242+
ASV_USE_IMPL, "int", *shapes[1], RAND_LOW, RAND_HIGH
243+
)
244+
if sort:
245+
self.df1.columns = self.df1.columns[::-1]
246+
247+
def time_append(self, shapes, sort):
248+
execute(self.df1.append(self.df2, sort=sort))
249+
250+
230251
class TimeBinaryOp:
231252
param_names = ["shapes", "binary_op", "axis"]
232253
params = [

0 commit comments

Comments
 (0)