refactor: Try to simplify StringColumn's CompactionOnDump, compact in place#181
refactor: Try to simplify StringColumn's CompactionOnDump, compact in place#181zhanglei1949 wants to merge 4 commits intoalibaba:mainfrom
Conversation
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
Review Summary by QodoSimplify StringColumn compaction to in-place algorithm
WalkthroughsDescription• Simplify StringColumn compaction by replacing streaming approach with in-place algorithm • Move file_header.h include from column.h to id_indexer.h for better dependency management • Remove unordered_set include and CompactionPlan struct, reducing complexity • Implement O(size_ log size_) in-place compaction that reclaims stale bytes from append-only updates Diagramflowchart LR
A["StringColumn dump()"] --> B["compact_in_place()"]
B --> C["Sort entries by offset"]
C --> D["Memmove bytes in-place"]
D --> E["Update item offsets"]
E --> F["Resize data_buffer_"]
F --> G["Store new pos_"]
File Changes1. include/neug/utils/id_indexer.h
|
Code Review by Qodo
|
270f93c to
624eb97
Compare
|
/review |
|
Persistent review updated to latest commit 07390e4 |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR refactors StringColumn’s dump-time compaction by removing the previous streaming-to-file compaction path and replacing it with an in-place compaction of data_buffer_ before dumping, addressing #177.
Changes:
- Replace the streaming compaction-on-dump implementation with an in-place
compact_in_place()routine. - Simplify
dump()to always compact, then dump containers normally. - Move
file_header.hinclude usage away fromcolumn.hintoid_indexer.h.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| include/neug/utils/property/column.h | Removes streaming compaction dump path and introduces in-place compaction logic for string data. |
| include/neug/utils/id_indexer.h | Adds file_header.h include (presumably to keep header definitions available where needed after refactor). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Another solution in #187
Fix #177