Commit 904adf9
committed
colexec: fix some benchmark issues due to a recent change
In 481387c, which was supposed to be
a no-op, we introduced a "closer registry" which resulted in some
microbenchmark regressions. This was the case because we would reuse the
same `CloserRegistry` for all iterations of the benchmark. Internally,
it is represented as a single slice, so it would grow quite large, and
only when tearing down the benchmark we would clean it up. This
introduced some extra memory usage and allocations which would
artificially slow down the benchmark and is now fixed (by resetting the
registry after each benchmark run).
This change logically makes sense too since it resembles how we use
these objects on the main query path - the registries are pooled and
reused via `vectorizedFlowCreator`.
We also apply the same change to the monitor registry. All benchmarks
using both registries have been adjusted accordingly.
The observed regression on `BenchmarkExternalSort` is now removed:
```
name old time/op new time/op delta
ExternalSort/rows=262144/cols=1/spilled=false-24 4.24ms ± 1% 3.11ms ± 2% -26.76% (p=0.000 n=10+9)
name old speed new speed delta
ExternalSort/rows=262144/cols=1/spilled=false-24 495MB/s ± 1% 675MB/s ± 2% +36.54% (p=0.000 n=10+9)
name old alloc/op new alloc/op delta
ExternalSort/rows=262144/cols=1/spilled=false-24 13.7MB ± 0% 13.7MB ± 0% +0.03% (p=0.000 n=10+9)
name old allocs/op new allocs/op delta
ExternalSort/rows=262144/cols=1/spilled=false-24 347 ± 0% 348 ± 0% +0.29% (p=0.000 n=10+10)
```
Release note: None1 parent 82b1a2b commit 904adf9
File tree
10 files changed
+67
-20
lines changed- pkg/sql
- colexec
- colexecargs
- colflow
10 files changed
+67
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
70 | | - | |
71 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
| |||
1155 | 1156 | | |
1156 | 1157 | | |
1157 | 1158 | | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
1158 | 1164 | | |
1159 | 1165 | | |
1160 | 1166 | | |
1161 | 1167 | | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
1162 | 1174 | | |
1163 | 1175 | | |
1164 | 1176 | | |
| |||
1186 | 1198 | | |
1187 | 1199 | | |
1188 | 1200 | | |
1189 | | - | |
1190 | | - | |
1191 | | - | |
| 1201 | + | |
1192 | 1202 | | |
1193 | 1203 | | |
1194 | 1204 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
272 | 272 | | |
273 | 273 | | |
274 | 274 | | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
427 | 427 | | |
428 | 428 | | |
429 | 429 | | |
430 | | - | |
431 | 430 | | |
432 | | - | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
433 | 435 | | |
434 | 436 | | |
435 | 437 | | |
| |||
476 | 478 | | |
477 | 479 | | |
478 | 480 | | |
| 481 | + | |
479 | 482 | | |
480 | 483 | | |
481 | 484 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
466 | 466 | | |
467 | 467 | | |
468 | 468 | | |
| 469 | + | |
469 | 470 | | |
470 | 471 | | |
471 | 472 | | |
| |||
611 | 612 | | |
612 | 613 | | |
613 | 614 | | |
| 615 | + | |
614 | 616 | | |
615 | 617 | | |
616 | 618 | | |
| |||
643 | 645 | | |
644 | 646 | | |
645 | 647 | | |
| 648 | + | |
646 | 649 | | |
647 | 650 | | |
648 | 651 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
274 | 274 | | |
275 | 275 | | |
276 | 276 | | |
277 | | - | |
278 | 277 | | |
279 | | - | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
280 | 282 | | |
281 | 283 | | |
282 | 284 | | |
| |||
305 | 307 | | |
306 | 308 | | |
307 | 309 | | |
| 310 | + | |
308 | 311 | | |
309 | 312 | | |
310 | 313 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
216 | | - | |
217 | 216 | | |
218 | | - | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
219 | 221 | | |
220 | 222 | | |
221 | 223 | | |
| |||
246 | 248 | | |
247 | 249 | | |
248 | 250 | | |
249 | | - | |
250 | | - | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
251 | 254 | | |
252 | 255 | | |
253 | 256 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
237 | | - | |
238 | 237 | | |
239 | | - | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
240 | 242 | | |
241 | 243 | | |
242 | 244 | | |
| |||
289 | 291 | | |
290 | 292 | | |
291 | 293 | | |
| 294 | + | |
292 | 295 | | |
293 | 296 | | |
294 | 297 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
230 | | - | |
231 | 230 | | |
232 | | - | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
233 | 235 | | |
234 | 236 | | |
235 | 237 | | |
| |||
280 | 282 | | |
281 | 283 | | |
282 | 284 | | |
| 285 | + | |
283 | 286 | | |
284 | 287 | | |
285 | 288 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
162 | | - | |
163 | 162 | | |
164 | | - | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
165 | 167 | | |
166 | 168 | | |
167 | 169 | | |
| |||
197 | 199 | | |
198 | 200 | | |
199 | 201 | | |
| 202 | + | |
200 | 203 | | |
201 | 204 | | |
202 | 205 | | |
| |||
0 commit comments