[ 
https://issues.apache.org/jira/browse/PHOENIX-6670?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17855492#comment-17855492
 ] 

Istvan Toth commented on PHOENIX-6670:
--------------------------------------

Another important difference is that KVs (really ExtendedCells) are modifiable, 
while Cells are effectively final.
Phoenix does use this feature in some plances.

> Optimize PhoenixKeyValueUtil#maybeCopyCell
> ------------------------------------------
>
>                 Key: PHOENIX-6670
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-6670
>             Project: Phoenix
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 5.2.0
>            Reporter: Istvan Toth
>            Priority: Major
>
> PhoenixKeyValueUtil#maybeCopyCell copies every cell that is not a KeyValue to 
> a keyValue.
> It's point is to copy Off-Heap cells to the Heap, so that the values are kept 
> after the backing ByteBuffer is freed, and we avoid use-after-free errors.
> However, checking if a Cell is a KeyValue instance is a poor indication for 
> that, as there are a lot of Cell types that are not KeyValues, but are stored 
> on the heap, and do not need to be copied.
> Copying only ByteBufferExtendedCell instances instead would potentially be a 
> significat performance gain.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to