You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Every read allocates a byte[] on the java heap, even if all that read is going to do is deserialize that byte[] into something else.
It would be useful to be able to read the data directly without the intermediate byte[].
Perhaps with a signature similar to:
<A> Aget(byte[] key, Function<DataInput, A> reader);
Access to a (native) ByteBuffer would also be useful, but this will become invalid if the file it points into is garbage collected. A different data structure could 'find' the memory again if it moved due to compaction and otherwise continue to use the old value. That might look like
ValueHandlegetValueHandle(byte[] key);
interfaceValueHandle {
booleanupdated(); // if the value was updated after the handle was created
<A> Aread(Function<DataInput, A> reader); // read whatever the current value is
}
The purpose of these would be to improve performance by decreasing allocations, and to allow for lazy-deserialization of larger data types. For example one might want to read only part of a value initially, and lazily load the remainder.
The text was updated successfully, but these errors were encountered:
Every read allocates a byte[] on the java heap, even if all that read is going to do is deserialize that byte[] into something else.
It would be useful to be able to read the data directly without the intermediate byte[].
Perhaps with a signature similar to:
Access to a (native) ByteBuffer would also be useful, but this will become invalid if the file it points into is garbage collected. A different data structure could 'find' the memory again if it moved due to compaction and otherwise continue to use the old value. That might look like
The purpose of these would be to improve performance by decreasing allocations, and to allow for lazy-deserialization of larger data types. For example one might want to read only part of a value initially, and lazily load the remainder.
The text was updated successfully, but these errors were encountered: