Darrel Schneider created GEODE-1280:
---------------------------------------

             Summary: DistributedCacheOperation.writeValue should cache the 
serialized new value it produces in EntryEventImpl
                 Key: GEODE-1280
                 URL: https://issues.apache.org/jira/browse/GEODE-1280
             Project: Geode
          Issue Type: Improvement
          Components: offheap
            Reporter: Darrel Schneider


Some of the callers of DistributedCacheOperation.writeValue call it to write 
the new value that is in the operation's EntryEventImpl. The writeValue code 
has to do the work of copying the value from off-heap memory to the message 
output stream.

EntryEventImpl has code that allows this serialized new value to be cached on 
the heap (see getCachedSerializedNewValue, setCachedSerializedNewValue, and 
setSerializedNewValue). It might improve performance if 
DistributedCacheOperation.writeValue called setCachedSerializedNewValue when it 
is writing the new value of an EntryEventImpl. The EntryEventImpl would need to 
be passed in to writeValue and not all callers of writeValue are writing a new 
value (some write and old value).

It is not clear how much benefit this optimization would have. The code that 
copies from off-heap has been optimized so creating the extra heap copy may end 
up being a deoptimization.

It is also possible that having writeValue cache the result in the 
EntryEventImpl could optimize a non-offheap case in which it would currently be 
serializing the new value more than once. If that is true then doing this would 
be a clear win. We only want to serialize a value once for the same operation.




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to