Question: Each KV pair has 2 copies in arena?
- Dominant language
- C++
- Stars
- 39.4k
- Forks
- 8.2k
- PR merge metrics
- No merged PRs in 30d
Description
I'm a C++ beginner, please correct me if I was wrong.
Is it possible to save a pointer to Key rather than a Key object in node?
First copy:
MemTable::Add(): char* buf = arena_.**Allocate**(encoded_len);
Second copy:
template
struct SkipList::Node {
explicit Node(const Key& k) : **key(k)** {}
Key const key;
...
}
Contributor guide
Research direction
Start with MemTable::Add() and the SkipList::Node definition shown in the issue. Trace how the arena-allocated buffer and the node's key are used, including their lifetimes and ownership. Done means establishing whether storing a pointer is safe and documenting the required change or why the existing representation should remain.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- database
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100