Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

puller(cdc): improve benchmarks about frontier #9731

Closed
wants to merge 4 commits into from

Conversation

hicqu
Copy link
Contributor

@hicqu hicqu commented Sep 12, 2023

What problem does this PR solve?

Issue Number: close #xxx

What is changed and how it works?

Check List

Tests

Benchmark results:

goos: linux
goarch: amd64
pkg: github.com/pingcap/tiflow/cdc/puller/frontier
cpu: Intel(R) Xeon(R) Gold 6240 CPU @ 2.60GHz
BenchmarkSpanForwardAndFrontier/900000(region)-10(round)-16                    1        17700041191 ns/op
BenchmarkSpanForwardAndFrontier/400000(region)-10(round)-16                    1        6722656192 ns/op

Questions

Will it cause performance regression or break compatibility?
Do you need to update user documentation, design documentation or monitoring documentation?

Release note

None

Signed-off-by: qupeng <[email protected]>
@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-linked-issue release-note-none Denotes a PR that doesn't merit a release note. labels Sep 12, 2023
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Sep 12, 2023

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from hicqu. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Sep 12, 2023
Comment on lines 55 to 62
for i := 0; i < regions*rounds; i++ {
offset := r.Uint64() % uint64(regions)
span := spans[offset]
if spanz.IsSubSpan(span, totalSpan) {
f.Forward(offset, span, offset)
if i%regions == 0 {
f.Frontier()
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Miss for i := 0; i < b.N; i++ { ... } ?

Signed-off-by: qupeng <[email protected]>
@hicqu
Copy link
Contributor Author

hicqu commented Sep 12, 2023

New results including random and ordered regions:

goos: linux
goarch: amd64
pkg: github.com/pingcap/tiflow/cdc/puller/frontier
cpu: Intel(R) Xeon(R) Gold 6240 CPU @ 2.60GHz
BenchmarkSpanForwardAndFrontier/random-900000(region)-10(round)-16                     1        15379538260 ns/op
BenchmarkSpanForwardAndFrontier/random-400000(region)-10(round)-16                     1        5812647147 ns/op
BenchmarkSpanForwardAndFrontier/ordered-900000(region)-10(round)-16                    1        4241320864 ns/op
BenchmarkSpanForwardAndFrontier/ordered-400000(region)-10(round)-16                    1        1996266167 ns/op

Signed-off-by: qupeng <[email protected]>
@hicqu
Copy link
Contributor Author

hicqu commented Sep 12, 2023

cpu: Intel(R) Xeon(R) Gold 6240 CPU @ 2.60GHz
BenchmarkSpanForwardAndFrontier_random_900k_10-16             10    15985935307 ns/op
--- BENCH: BenchmarkSpanForwardAndFrontier_random_900k_10-16
    frontier_bench_test.go:82: finishes a round, time in ms: 15936
    frontier_bench_test.go:82: finishes a round, time in ms: 17908
    frontier_bench_test.go:82: finishes a round, time in ms: 15190
    frontier_bench_test.go:82: finishes a round, time in ms: 16690
    frontier_bench_test.go:82: finishes a round, time in ms: 16611
    frontier_bench_test.go:82: finishes a round, time in ms: 16530
    frontier_bench_test.go:82: finishes a round, time in ms: 14907
    frontier_bench_test.go:82: finishes a round, time in ms: 15897
    frontier_bench_test.go:82: finishes a round, time in ms: 16225
    frontier_bench_test.go:82: finishes a round, time in ms: 14238
    ... [output truncated]
BenchmarkSpanForwardAndFrontier_ordered_900k_10-16            10    4353450849 ns/op
--- BENCH: BenchmarkSpanForwardAndFrontier_ordered_900k_10-16
    frontier_bench_test.go:82: finishes a round, time in ms: 4190
    frontier_bench_test.go:82: finishes a round, time in ms: 4381
    frontier_bench_test.go:82: finishes a round, time in ms: 3836
    frontier_bench_test.go:82: finishes a round, time in ms: 4466
    frontier_bench_test.go:82: finishes a round, time in ms: 4353
    frontier_bench_test.go:82: finishes a round, time in ms: 4759
    frontier_bench_test.go:82: finishes a round, time in ms: 4296
    frontier_bench_test.go:82: finishes a round, time in ms: 4182
    frontier_bench_test.go:82: finishes a round, time in ms: 4514
    frontier_bench_test.go:82: finishes a round, time in ms: 4302
    ... [output truncated]
BenchmarkSpanForwardAndFrontier_random_400k_10-16             10    6295161930 ns/op
--- BENCH: BenchmarkSpanForwardAndFrontier_random_400k_10-16
    frontier_bench_test.go:82: finishes a round, time in ms: 5351
    frontier_bench_test.go:82: finishes a round, time in ms: 5825
    frontier_bench_test.go:82: finishes a round, time in ms: 7055
    frontier_bench_test.go:82: finishes a round, time in ms: 6295
    frontier_bench_test.go:82: finishes a round, time in ms: 6559
    frontier_bench_test.go:82: finishes a round, time in ms: 6832
    frontier_bench_test.go:82: finishes a round, time in ms: 6155
    frontier_bench_test.go:82: finishes a round, time in ms: 6012
    frontier_bench_test.go:82: finishes a round, time in ms: 6599
    frontier_bench_test.go:82: finishes a round, time in ms: 5589
    ... [output truncated]
BenchmarkSpanForwardAndFrontier_ordered_400k_10-16            10    1737459993 ns/op
--- BENCH: BenchmarkSpanForwardAndFrontier_ordered_400k_10-16
    frontier_bench_test.go:82: finishes a round, time in ms: 1903
    frontier_bench_test.go:82: finishes a round, time in ms: 1707
    frontier_bench_test.go:82: finishes a round, time in ms: 1933
    frontier_bench_test.go:82: finishes a round, time in ms: 1801
    frontier_bench_test.go:82: finishes a round, time in ms: 1453
    frontier_bench_test.go:82: finishes a round, time in ms: 1787
    frontier_bench_test.go:82: finishes a round, time in ms: 1834
    frontier_bench_test.go:82: finishes a round, time in ms: 1499
    frontier_bench_test.go:82: finishes a round, time in ms: 1958
    frontier_bench_test.go:82: finishes a round, time in ms: 1522
    ... [output truncated]

Conclusions:
when Frontier handles ResolvedTs events, the effeciency can be influenced by whether regions are contiguous or not.

Signed-off-by: qupeng <[email protected]>
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Sep 13, 2023

[FORMAT CHECKER NOTIFICATION]

Notice: To remove the do-not-merge/needs-linked-issue label, please provide the linked issue number on one line in the PR body, for example: Issue Number: close #123 or Issue Number: ref #456.

📖 For more info, you can check the "Contribute Code" section in the development guide.

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Sep 13, 2023

@hicqu: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
jenkins-ticdc/verify 719751e link true /test verify

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@nongfushanquan
Copy link
Contributor

/close

@ti-chi-bot ti-chi-bot bot closed this Sep 27, 2023
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Sep 27, 2023

@nongfushanquan: Closed this PR.

In response to this:

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/needs-linked-issue release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants