Introduce RowData structure for efficient CDC event handling#21
Introduce RowData structure for efficient CDC event handling#21
Conversation
isdaniel
commented
Feb 16, 2026
- Replace HashMap<String, serde_json::Value> with RowData for event payloads.
- Use Arc for column names to optimize memory usage.
- Implement methods for RowData including push, get, and serialization.
- Update ChangeEvent to utilize RowData for Insert, Update, and Delete events.
- Add benchmarks comparing RowData performance against the old HashMap approach.
- Replace HashMap<String, serde_json::Value> with RowData for event payloads. - Use Arc<str> for column names to optimize memory usage. - Implement methods for RowData including push, get, and serialization. - Update ChangeEvent to utilize RowData for Insert, Update, and Delete events. - Add benchmarks comparing RowData performance against the old HashMap approach.
Summary of ChangesHello @isdaniel, 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 introduces a fundamental optimization to how Change Data Capture (CDC) event payloads are handled. By replacing 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. Changelog
Activity
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
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #21 +/- ##
==========================================
+ Coverage 87.97% 88.12% +0.14%
==========================================
Files 8 8
Lines 7019 7056 +37
==========================================
+ Hits 6175 6218 +43
+ Misses 844 838 -6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Code Review
This is an excellent pull request that significantly improves the efficiency of CDC event handling by replacing HashMap<String, Value> with a custom RowData structure. The use of Arc<str> for column names, schemas, and table names is a smart optimization that reduces memory allocations and cloning overhead. The new RowData struct is well-designed, and its serialization to a JSON object ensures backward compatibility. I'm particularly impressed with the comprehensive benchmarks you've added, which clearly demonstrate the performance gains of this new approach across various workloads. The API changes are handled gracefully with deprecation attributes, and the documentation has been updated accordingly. I have a couple of suggestions to improve consistency and performance further, but overall, this is a high-quality contribution.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a significant performance improvement by replacing HashMap<String, serde_json::Value> with a custom RowData struct for handling CDC event payloads. The new RowData struct, which is essentially a Vec<(Arc<str>, serde_json::Value)>, reduces memory allocations and eliminates hashing overhead by using Arc<str> for column names and other identifiers. The changes are well-executed and consistently applied throughout the codebase, including core data types, protocol parsing, stream processing logic, and examples. The addition of a comprehensive benchmark suite to validate the performance gains is particularly commendable. The code quality is high, with good documentation for the new RowData struct. I've only found a couple of minor areas for improvement in the tests to ensure their robustness is maintained after the refactoring.