iowow icon indicating copy to clipboard operation
iowow copied to clipboard

[Question] Reading values without incurring a copy?

Open kennycarruthers opened this issue 2 years ago • 1 comments

Is it possible to access the value of a key without incurring a memory copy? A cursory look through the code suggests that _kvblk_value_get is the main entry point for reading values where a malloc and memcpy are required to read the value.

Is there any way to just have a pointer to the value returned? This can be beneficial if the value is serialized data such as a FlatBuffer or Binn that supports zero-copy operations. RocksDB has something called PinnableSlices that allows this. I'm curious if there's anyway to achieve something similar in iowow.

kennycarruthers avatar Mar 04 '22 06:03 kennycarruthers

Hi @kennycarruthers! Sure currently its not possibly to get record without copying, will try to add some handy api this week.

adamansky avatar Apr 11 '22 03:04 adamansky