Skip to content

Commit f19c6ed

Browse files
committed
Add a benchmark for Index creation
1 parent d97e7be commit f19c6ed

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

asv_bench/benchmarks/index_object.py

+11
Original file line numberDiff line numberDiff line change
@@ -258,4 +258,15 @@ def peakmem_gc_instances(self, N):
258258
gc.enable()
259259

260260

261+
class Creation:
262+
param_names = ["dtype", "size"]
263+
params = [["uint8", "uint32", "int32", "float64", "float32"], [0, 1, 10, 100, 200]]
264+
265+
def setup(self, dtype, size):
266+
self.array = np.zeros(size, dtype=dtype)
267+
268+
def time_creation(self, dtype, size):
269+
Index(self.array)
270+
271+
261272
from .pandas_vb_common import setup # noqa: F401 isort:skip

0 commit comments

Comments
 (0)