Commit 0c9c77f
Merge cockroachdb#154341
154341: changefeedccl/resolvedspan: benchmark frontier per-table tracking r=KeithCh,asg0451 a=andyyang890
Fixes cockroachdb#152111
---
This patch adds a new benchmark for frontier per-table tracking.
Results when I run the benchmark on my laptop:
```
goos: darwin
goarch: arm64
cpu: Apple M1 Pro
BenchmarkFrontierPerTableTracking/system/aggregator/per-table-tracking=false
BenchmarkFrontierPerTableTracking/system/aggregator/per-table-tracking=false 11734448 93.39 ns/op 0 B/op 0 allocs/op
BenchmarkFrontierPerTableTracking/system/aggregator/per-table-tracking=true
BenchmarkFrontierPerTableTracking/system/aggregator/per-table-tracking=true 6423613 171.1 ns/op 16 B/op 2 allocs/op
BenchmarkFrontierPerTableTracking/system/coordinator/per-table-tracking=false
BenchmarkFrontierPerTableTracking/system/coordinator/per-table-tracking=false 14056830 87.45 ns/op 0 B/op 0 allocs/op
BenchmarkFrontierPerTableTracking/system/coordinator/per-table-tracking=true
BenchmarkFrontierPerTableTracking/system/coordinator/per-table-tracking=true 7310874 157.4 ns/op 16 B/op 2 allocs/op
BenchmarkFrontierPerTableTracking/tenant/aggregator/per-table-tracking=false
BenchmarkFrontierPerTableTracking/tenant/aggregator/per-table-tracking=false 14520753 82.53 ns/op 0 B/op 0 allocs/op
BenchmarkFrontierPerTableTracking/tenant/aggregator/per-table-tracking=true
BenchmarkFrontierPerTableTracking/tenant/aggregator/per-table-tracking=true 7783419 160.1 ns/op 16 B/op 2 allocs/op
BenchmarkFrontierPerTableTracking/tenant/coordinator/per-table-tracking=false
BenchmarkFrontierPerTableTracking/tenant/coordinator/per-table-tracking=false 14832232 83.03 ns/op 0 B/op 0 allocs/op
BenchmarkFrontierPerTableTracking/tenant/coordinator/per-table-tracking=true
BenchmarkFrontierPerTableTracking/tenant/coordinator/per-table-tracking=true 8280913 164.1 ns/op 16 B/op 2 allocs/op
```
From profiling, the allocs and some of the slowdown when per-table
tracking is on comes from constructing the full table spans.
We could consider caching them in the future if we see a need.
Release note: None
Co-authored-by: Andy Yang <[email protected]>File tree
3 files changed
+166
-1
lines changed- pkg/ccl/changefeedccl/resolvedspan
3 files changed
+166
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
28 | 31 | | |
29 | 32 | | |
| 33 | + | |
| 34 | + | |
30 | 35 | | |
31 | 36 | | |
32 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
33 | 41 | | |
34 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
35 | 46 | | |
36 | 47 | | |
37 | 48 | | |
38 | 49 | | |
39 | 50 | | |
| 51 | + | |
40 | 52 | | |
41 | 53 | | |
42 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
| 13 | + | |
11 | 14 | | |
| 15 | + | |
12 | 16 | | |
13 | 17 | | |
14 | 18 | | |
15 | 19 | | |
16 | 20 | | |
17 | 21 | | |
| 22 | + | |
| 23 | + | |
18 | 24 | | |
19 | 25 | | |
20 | 26 | | |
21 | 27 | | |
22 | 28 | | |
| 29 | + | |
23 | 30 | | |
24 | 31 | | |
25 | 32 | | |
| |||
172 | 179 | | |
173 | 180 | | |
174 | 181 | | |
| 182 | + | |
175 | 183 | | |
176 | 184 | | |
177 | 185 | | |
| |||
530 | 538 | | |
531 | 539 | | |
532 | 540 | | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
0 commit comments