Skip to content
Prev Previous commit
Next Next commit
ASV: increase runtime of frame_methods.Update
  • Loading branch information
aureliobarbosa committed Apr 13, 2024
commit 877e6fe99da6061b97c5e768b16e74c7973292ae
10 changes: 6 additions & 4 deletions asv_bench/benchmarks/frame_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -865,14 +865,16 @@ def time_last_valid_index(self, dtype):
class Update:
def setup(self):
rng = np.random.default_rng()
self.df = DataFrame(rng.uniform(size=(1000, 10)))
self.df = DataFrame(rng.uniform(size=(10_000, 10)))

idx = rng.choice(range(1000), size=1000, replace=False)
idx = rng.choice(range(10_000), size=10_000, replace=False)
self.df_random = DataFrame(self.df, index=idx)

idx = rng.choice(range(1000), size=100, replace=False)
idx = rng.choice(range(10_000), size=1_000, replace=False)
cols = rng.choice(range(10), size=2, replace=False)
self.df_sample = DataFrame(rng.uniform(size=(100, 2)), index=idx, columns=cols)
self.df_sample = DataFrame(
rng.uniform(size=(1_000, 2)), index=idx, columns=cols
)

def time_to_update_big_frame_small_arg(self):
self.df.update(self.df_sample)
Expand Down