-
Notifications
You must be signed in to change notification settings - Fork 245
perf: tune badger defaults and add db bench #2950
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
Conversation
|
The latest Buf updates on your PR. Results from workflow CI / buf-check (pull_request).
|
|
Claude finished @tac0turtle's task in 2m 17s —— View job Comprehensive Code ReviewI've completed a thorough review of this PR. The changes are well-structured and provide valuable performance tuning for BadgerDB. Below is my detailed feedback across all review areas: SummaryOverall Assessment: ✅ Approve with minor suggestions This PR successfully tunes BadgerDB for ev-node's write-heavy workload and adds a useful benchmarking tool. The changes are backward compatible, well-documented, and follow Go best practices. The tuned options are sensible for append-heavy patterns with periodic overwrites. 1. Code Quality & Architecture✅ Strong PointsBadgerDB Options (
Integration (
Benchmark Tool (
🔍 Minor Observations
2. Error Handling & Resilience✅ Good Practices
|
Summary of ChangesHello @tac0turtle, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the performance of the BadgerDB key-value store by introducing a set of finely-tuned default options tailored for the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request introduces performance tuning for BadgerDB by providing a set of default options tailored for the application's write patterns. It also adds a new benchmark tool, db-bench, to validate these performance improvements. The changes are well-structured and the new options are correctly applied. The benchmark tool is a valuable addition. I have provided a couple of suggestions to improve the implementation of the benchmark tool for better error handling and code clarity.
| for _, p := range selected { | ||
| profileDir := filepath.Join(baseDir, p.name) | ||
| if cfg.reset { | ||
| _ = os.RemoveAll(profileDir) |
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.
The error returned by os.RemoveAll is ignored. If removing the directory fails (e.g., due to permissions), the benchmark might run with old data or fail at a later stage, leading to confusing results. It would be better to handle this error, for instance by logging a warning to the user.
| _ = os.RemoveAll(profileDir) | |
| if err := os.RemoveAll(profileDir); err != nil { | |
| fmt.Fprintf(os.Stderr, "Warning: failed to remove profile directory %s: %v\n", profileDir, err) | |
| } |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2950 +/- ##
==========================================
- Coverage 58.74% 57.61% -1.14%
==========================================
Files 93 95 +2
Lines 8863 9043 +180
==========================================
+ Hits 5207 5210 +3
- Misses 3067 3242 +175
- Partials 589 591 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
julienrbrt
left a comment
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.
utACK. @claude is this backward compatible?
|
Claude finished @tac0turtle's task in 55s —— View job Analyzing Backward Compatibility
Answer: Yes, this is backward compatible ✅The changes in this PR are fully backward compatible with existing deployments. Here's why: What ChangedThe PR modifies runtime behavior only, not data format: Before: The tuned options are:
Why It's Compatible
Migration PathNo migration needed! Nodes can upgrade by:
The existing BadgerDB data will be read normally, and the new tuning will apply to subsequent operations. Rollback SafetyIf needed, you can roll back to the old code ( Bottom line: This is a safe, non-breaking performance optimization. Existing deployments can upgrade without any migration steps or data conversion. |
Overview
Tune badgerdb for our write heavy usecase, this is a small change i dont believe we need to go beyond this
closes #2605