Commit 311a6f5
committed
test: use _DummyListBuffer in test_reads.py to avoid GIL contention (googleapis#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 f1a4f9e commit 311a6f5
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 | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | 26 | | |
28 | | - | |
29 | 27 | | |
30 | 28 | | |
31 | 29 | | |
| |||
226 | 224 | | |
227 | 225 | | |
228 | 226 | | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
229 | 247 | | |
230 | 248 | | |
231 | 249 | | |
| |||
253 | 271 | | |
254 | 272 | | |
255 | 273 | | |
256 | | - | |
| 274 | + | |
257 | 275 | | |
258 | 276 | | |
259 | | - | |
| 277 | + | |
260 | 278 | | |
261 | 279 | | |
262 | 280 | | |
263 | 281 | | |
264 | 282 | | |
265 | 283 | | |
266 | | - | |
| 284 | + | |
267 | 285 | | |
268 | 286 | | |
269 | 287 | | |
| |||
0 commit comments