Skip to content

Commit 48fe31e

Browse files
committed
use random order of elements rather than sorted, for sorted elements the search in the sorted arrays will have too few cache misses
1 parent f543f15 commit 48fe31e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

asv_bench/benchmarks/series_methods.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,11 @@ def time_isin_long_series_long_values_floats(self):
9191

9292

9393
class IsInLongSeries(object):
94-
params = [['int64', 'int32', 'float64', 'float32'], [1, 2, 5, 10, 1000, 10**5]]
95-
param_names = ['dtype', 'M']
94+
params = [["int64", "int32", "float64", "float32"], [1, 2, 5, 10, 1000, 10 ** 5]]
95+
param_names = ["dtype", "M"]
9696

9797
def setup(self, dtype, M):
98-
self.s = Series(np.arange(10**7)).astype(dtype)
98+
self.s = Series(np.random.randint(0, M, 10 ** 7)).astype(dtype)
9999
self.values = np.arange(M).astype(dtype)
100100

101101
def time_isin(self, dtypes, M):

0 commit comments

Comments
 (0)