This repository was archived by the owner on Jan 21, 2026. It is now read-only.
Commit 5d7528d
committed
c api: optimize uniq raw ptr wrapper
c api wrap many rocksdb ptr types, such as rocksdb::Iterator is warpped as:
struct rocksdb_iterator_t {
Iterator* rep;
};
this introduced an indirect ptr access, making it slow, esp. ToplingDB
is very fast such as iter->key() latency is less than 5 ns, this overhead
is significant compared to real work.
In this commit, such warps are optimized out, `rocksdb::Iterator*` is
converted to and from `rocksdb_iterator_t*`, to minimize code changes,
we add template class ObjectAtHere as a place holder to emulate `rep`'s
behavior.
Not all such ptrs can be safely optimized, other similar wrapped ptrs are:
1. DB*
2. ColumnFamilyHandle*
3. TransactionDB*
4. OptimisticTransactionDB*1 parent 70c603b commit 5d7528d
1 file changed
+85
-108
lines changed
0 commit comments