Skip to content

Commit 4f5eda9

Browse files
committed
adding benchmark for isin with many elements
1 parent e76a39c commit 4f5eda9

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

asv_bench/benchmarks/series_methods.py

+12
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,18 @@ def time_isin_long_series_long_values_floats(self):
9090
self.s_long_floats.isin(self.vals_long_floats)
9191

9292

93+
class IsInLongSeries(object):
94+
params = [['int64', 'int32', 'float64', 'float32'], [1, 2, 5, 10, 1000, 10**5]]
95+
param_names = ['dtype', 'M']
96+
97+
def setup(self, dtype, M):
98+
self.s = Series(np.arange(10**7)).astype(dtype)
99+
self.values = np.arange(M).astype(dtype)
100+
101+
def time_isin(self, dtypes, M):
102+
self.s.isin(self.values)
103+
104+
93105
class NSort:
94106

95107
params = ["first", "last", "all"]

0 commit comments

Comments
 (0)