-
Notifications
You must be signed in to change notification settings - Fork 237
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
Problem: memiavl restore not fast enough #1241
Conversation
Solution: - increase channel buffer size to improve parallisation it reduce restore time by 44% when testing with testnet, thanks @yzang2019 for sharing the finding.
WalkthroughThe recent update brings a significant enhancement to the system's performance and stability, focusing on two main areas: the websocket/subscription system and the memiavl restoration process. The websocket system has been refactored for better efficiency, while memiavl restoration now benefits from improved parallelization, ensuring faster and more reliable data handling. Changes
TipsChat with CodeRabbit Bot (
|
Signed-off-by: yihuang <huang@crypto.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 1
Configuration used: CodeRabbit UI
Files selected for processing (2)
- CHANGELOG.md (1 hunks)
- memiavl/import.go (2 hunks)
Additional comments: 2
memiavl/import.go (2)
11-11: The introduction of a new constant
NodeChannelBuffer
is a good practice for managing magic numbers and improving code readability. Ensure that the value of 2048 is appropriate for all deployment scenarios, as a buffer that is too large may consume unnecessary memory, while one that is too small may not provide the intended performance benefits.104-105: Changing from an unbuffered to a buffered channel with a size of 2048 is a significant change that should improve the throughput of concurrent operations. However, it's important to ensure that the rest of the system can handle the increased concurrency without introducing bottlenecks elsewhere. Additionally, consider monitoring memory usage, as larger buffers can lead to increased memory consumption.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 2
Configuration used: CodeRabbit UI
Files selected for processing (1)
- CHANGELOG.md (1 hunks)
Additional comments: 1
CHANGELOG.md (1)
- 17-21: The changelog entries for the improvements are clear and concise, providing direct links to the pull requests for users to find more detailed information. It's good practice to include such references for transparency and traceability.
LGTM, I think you might also want to fix your unit test like: sei-protocol/sei-db#33 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (1)
- memiavl/snapshot_test.go (1 hunks)
Files skipped from review due to trivial changes (1)
- memiavl/snapshot_test.go
thanks, added. |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1241 +/- ##
===========================================
+ Coverage 16.67% 36.89% +20.22%
===========================================
Files 79 115 +36
Lines 5786 10255 +4469
===========================================
+ Hits 965 3784 +2819
- Misses 4743 6097 +1354
- Partials 78 374 +296
|
) * Problem: memiavl restore not fast enough Solution: - increase channel buffer size to improve parallisation it reduce restore time by 44% when testing with testnet, thanks @yzang2019 for sharing the finding. * Update CHANGELOG.md Signed-off-by: yihuang <huang@crypto.com> * fix unit test --------- Signed-off-by: yihuang <huang@crypto.com>
* Problem: memiavl restore not fast enough Solution: - increase channel buffer size to improve parallisation it reduce restore time by 44% when testing with testnet, thanks @yzang2019 for sharing the finding. * Update CHANGELOG.md * fix unit test --------- Signed-off-by: yihuang <huang@crypto.com>
Solution:
it reduce restore time by 44% when testing with testnet snapshot, thanks @yzang2019 for sharing the finding.
👮🏻👮🏻👮🏻 !!!! REFERENCE THE PROBLEM YOUR ARE SOLVING IN THE PR TITLE AND DESCRIBE YOUR SOLUTION HERE !!!! DO NOT FORGET !!!! 👮🏻👮🏻👮🏻
PR Checklist:
make
)make test
)go fmt
)golangci-lint run
)go list -json -m all | nancy sleuth
)Thank you for your code, it's appreciated! :)
Summary by CodeRabbit
Performance Improvements
Refactor