Skip to content

Commit

Permalink
Comments on allocation in getOutputSlice
Browse files Browse the repository at this point in the history
  • Loading branch information
alanpaxton committed Jan 25, 2023
1 parent 4e8fe61 commit 5dd3543
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions java/src/main/java/org/rocksdb/FFIDB.java
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,10 @@ public GetOutputSlice getOutputSlice(
final ReadOptions readOptions,
final ColumnFamilyHandle columnFamilyHandle, final MemorySegment outputSegment, final MemorySegment keySegment) throws RocksDBException {

//TODO (AP) - we could help performance by not allocating here in the inner loop, instead use a GetParams-like
//TODO (AP) - pattern of passing in the input slice and the output slice
//TODO (AP) - it pay not make a lot of difference in practice, as {@code segmentAllocator} is an efficient native arena
//TODO (AP) - and the performance we actually see, also suggests it doesn't generate much impact/overhead
final MemorySegment inputSlice = segmentAllocator.allocate(FFILayout.InputSlice.Layout);
FFILayout.InputSlice.Data.set(inputSlice, keySegment.address());
FFILayout.InputSlice.Size.set(
Expand Down

0 comments on commit 5dd3543

Please sign in to comment.