Skip to content

Commit f2b1e10

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

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

asv_bench/benchmarks/index_object.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,4 +258,18 @@ def peakmem_gc_instances(self, N):
258258
gc.enable()
259259

260260

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

0 commit comments

Comments
 (0)