Commit c3c609e
authored
test: use _DummyListBuffer in test_reads.py to avoid GIL contention (#16860)
This PR replaces `io.BytesIO` with a custom `_DummyListBuffer` in
`test_reads.py`.
During profiling, `io.BytesIO.write()` holds the GIL while copying data.
This introduces significant noise and bottlenecks in performance tests
with high concurrency or large data transfers.
This change avoids GIL contention and reduces noise when profiling the
code (specifically noted by the user as causing noise when profiling the
format code).1 parent 4e535d2 commit c3c609e
1 file changed
Lines changed: 23 additions & 5 deletions
Lines changed: 23 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | 22 | | |
24 | | - | |
25 | 23 | | |
26 | 24 | | |
27 | 25 | | |
| |||
170 | 168 | | |
171 | 169 | | |
172 | 170 | | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
173 | 191 | | |
174 | 192 | | |
175 | 193 | | |
| |||
197 | 215 | | |
198 | 216 | | |
199 | 217 | | |
200 | | - | |
| 218 | + | |
201 | 219 | | |
202 | 220 | | |
203 | | - | |
| 221 | + | |
204 | 222 | | |
205 | 223 | | |
206 | 224 | | |
207 | 225 | | |
208 | 226 | | |
209 | 227 | | |
210 | | - | |
| 228 | + | |
211 | 229 | | |
212 | 230 | | |
213 | 231 | | |
| |||
0 commit comments