Skip to content

Commit ef49ca3

Browse files
committed
adding values-dominate asv-tests
1 parent 3d781be commit ef49ca3

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

asv_bench/benchmarks/series_methods.py

+24-2
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@ def time_isin_long_series_long_values_floats(self):
9090
self.s_long_floats.isin(self.vals_long_floats)
9191

9292

93-
class IsInLongSeries:
93+
class IsInLongSeriesLookUpDominates:
9494
params = [
9595
["int64", "int32", "float64", "float32", "object"],
96-
[1, 2, 5, 10, 50, 100, 1000, 10 ** 5],
96+
[1, 2, 5, 10, 16, 50, 100, 1000, 10 ** 5],
9797
["random_hits", "random_misses", "monotone_hits", "monotone_misses"],
9898
]
9999
param_names = ["dtype", "MaxNumber", "series_type"]
@@ -117,6 +117,28 @@ def time_isin(self, dtypes, MaxNumber, series_type):
117117
self.series.isin(self.values)
118118

119119

120+
class IsInLongSeriesValuesDominate:
121+
params = [
122+
["int64", "int32", "float64", "float32", "object"],
123+
["random", "monotone"],
124+
]
125+
param_names = ["dtype", "series_type"]
126+
127+
def setup(self, dtype, series_type):
128+
N = 10 ** 7
129+
if series_type == "random":
130+
np.random.seed(42)
131+
vals = np.random.randint(0, 10 * N, N)
132+
if series_type == "monotone":
133+
vals = np.arange(N)
134+
self.values = vals.astype(dtype)
135+
M = 10 ** 6 + 1
136+
self.series = Series(np.arange(M)).astype(dtype)
137+
138+
def time_isin(self, dtypes, series_type):
139+
self.series.isin(self.values)
140+
141+
120142
class NSort:
121143

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

0 commit comments

Comments
 (0)