diff --git a/asv_bench/benchmarks/ctors.py b/asv_bench/benchmarks/ctors.py index 1c6841a296377..42adede631a01 100644 --- a/asv_bench/benchmarks/ctors.py +++ b/asv_bench/benchmarks/ctors.py @@ -55,7 +55,14 @@ class SeriesConstructors: [False, True], ['float', 'int']] + # Generators get exhausted on use, so run setup before every call + number = 1 + repeat = (3, 250, 10) + def setup(self, data_fmt, with_index, dtype): + if data_fmt in (gen_of_str, gen_of_tuples) and with_index: + raise NotImplementedError('Series constructors do not support ' + 'using generators with indexes') N = 10**4 if dtype == 'float': arr = np.random.randn(N) diff --git a/asv_bench/benchmarks/frame_ctor.py b/asv_bench/benchmarks/frame_ctor.py index 19c2a913e8494..9533938b30fac 100644 --- a/asv_bench/benchmarks/frame_ctor.py +++ b/asv_bench/benchmarks/frame_ctor.py @@ -72,6 +72,10 @@ class FromRecords: params = [None, 1000] param_names = ['nrows'] + # Generators get exhausted on use, so run setup before every call + number = 1 + repeat = (3, 250, 10) + def setup(self, nrows): N = 100000 self.gen = ((x, (x * 20), (x * 100)) for x in range(N))