@@ -116,16 +116,26 @@ class FrameWithFrameWide:
116
116
operator .add ,
117
117
operator .floordiv ,
118
118
operator .gt ,
119
- ]
119
+ ],
120
+ [
121
+ # (n_rows, n_columns)
122
+ (1_000_000 , 10 ),
123
+ (100_000 , 100 ),
124
+ (10_000 , 1000 ),
125
+ (1000 , 10_000 ),
126
+ ],
120
127
]
121
- param_names = ["op" ]
128
+ param_names = ["op" , "shape" ]
122
129
123
- def setup (self , op ):
130
+ def setup (self , op , shape ):
124
131
# we choose dtypes so as to make the blocks
125
132
# a) not perfectly match between right and left
126
133
# b) appreciably bigger than single columns
127
- n_cols = 2000
128
- n_rows = 500
134
+ n_rows , n_cols = shape
135
+
136
+ if op is operator .floordiv :
137
+ # floordiv is much slower than the other operations -> use less data
138
+ n_rows = n_rows // 10
129
139
130
140
# construct dataframe with 2 blocks
131
141
arr1 = np .random .randn (n_rows , n_cols // 2 ).astype ("f8" )
@@ -137,7 +147,7 @@ def setup(self, op):
137
147
df ._consolidate_inplace ()
138
148
139
149
# TODO: GH#33198 the setting here shoudlnt need two steps
140
- arr1 = np .random .randn (n_rows , n_cols // 4 ).astype ("f8" )
150
+ arr1 = np .random .randn (n_rows , max ( n_cols // 4 , 3 ) ).astype ("f8" )
141
151
arr2 = np .random .randn (n_rows , n_cols // 2 ).astype ("i8" )
142
152
arr3 = np .random .randn (n_rows , n_cols // 4 ).astype ("f8" )
143
153
df2 = pd .concat (
@@ -151,11 +161,11 @@ def setup(self, op):
151
161
self .left = df
152
162
self .right = df2
153
163
154
- def time_op_different_blocks (self , op ):
164
+ def time_op_different_blocks (self , op , shape ):
155
165
# blocks (and dtypes) are not aligned
156
166
op (self .left , self .right )
157
167
158
- def time_op_same_blocks (self , op ):
168
+ def time_op_same_blocks (self , op , shape ):
159
169
# blocks (and dtypes) are aligned
160
170
op (self .left , self .left )
161
171
0 commit comments