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

Improve mgmt sync performance #2363

Merged
merged 13 commits into from
Aug 7, 2024
Merged

Improve mgmt sync performance #2363

merged 13 commits into from
Aug 7, 2024

Conversation

lixmal
Copy link
Contributor

@lixmal lixmal commented Jul 31, 2024

Describe your changes

old:

$ go test -run '^$' -bench=BenchmarkUpdateAccountPeers ./management/server
goos: linux
goarch: amd64
pkg: github.com/netbirdio/netbird/management/server
cpu: 13th Gen Intel(R) Core(TM) i7-1355U
BenchmarkUpdateAccountPeers/Small-12                 568                 1.826 ms/op
BenchmarkUpdateAccountPeers/Medium-12                  9               139.3 ms/op
BenchmarkUpdateAccountPeers/Large-12                   1             15933 ms/op
BenchmarkUpdateAccountPeers/Small_single-12          198                 5.620 ms/op
BenchmarkUpdateAccountPeers/Medium_single-12           2               569.7 ms/op
BenchmarkUpdateAccountPeers/Large_5-12                 1             25845 ms/op
PASS
ok      github.com/netbirdio/netbird/management/server  59.603s

new:

$ go test -run '^$' -bench=BenchmarkUpdateAccountPeers ./management/server
goos: linux
goarch: amd64
pkg: github.com/netbirdio/netbird/management/server
cpu: 13th Gen Intel(R) Core(TM) i7-1355U
BenchmarkUpdateAccountPeers/Small-12                 649                 1.824 ms/op
BenchmarkUpdateAccountPeers/Medium-12                 30                53.51 ms/op
BenchmarkUpdateAccountPeers/Large-12                   1              4022 ms/op
BenchmarkUpdateAccountPeers/Small_single-12          664                 4.034 ms/op
BenchmarkUpdateAccountPeers/Medium_single-12           4               311.5 ms/op
BenchmarkUpdateAccountPeers/Large_5-12                 1              7261 ms/op
PASS
ok      github.com/netbirdio/netbird/management/server  28.074s
Benchmark Old Time (ms) New Time (ms) Improvement (%)
Small 1.826 1.824 0.11%
Medium 139.3 53.51 61.59%
Large 15933 4022 74.76%
Small_single 5.620 4.034 28.22%
Medium_single 569.7 311.5 45.32%
Large_5 25845 7261 71.90%

Issue ticket number and link

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • Extended the README / documentation, if necessary

@lixmal lixmal force-pushed the feature/improve-sync-performance branch from 2d04c6d to e48cde8 Compare August 1, 2024 08:31
@mlsmaycon mlsmaycon self-requested a review August 6, 2024 09:49
mlsmaycon
mlsmaycon previously approved these changes Aug 6, 2024
Copy link

sonarqubecloud bot commented Aug 6, 2024

@lixmal lixmal merged commit ac0d5ff into main Aug 7, 2024
25 checks passed
@lixmal lixmal deleted the feature/improve-sync-performance branch August 7, 2024 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants