[
https://issues.apache.org/jira/browse/CASSANDRA-5020?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13529052#comment-13529052
]
Jonathan Ellis edited comment on CASSANDRA-5020 at 12/11/12 3:29 PM:
---------------------------------------------------------------------
I don't think switching to byte[] is crazy either. We'd save over 50% vs
ByteBuffer on small columns like ints, even if we are comparing
off-heap-bytebuffer with on-heap-byte[], simply because BB's extra fields are
so big.
That is,
bq. A HeapByteBuffer wastes a lot of memory compared to a byte[] (5 more ints,
a long, and a boolean).
also goes for DirectByteBuffer (those fields are all declared in ByteBuffer
that HBB and DBB extend).
Of course, as the data size increases, this advantage disappears as DBB's heap
usage stays constant while byte[] or HBB grows with it.
was (Author: jbellis):
I don't think switching to byte[] is crazy either. We'd save over 50% vs
ByteBuffer on small columns like ints, even if we are comparing
off-heap-bytebuffer with on-heap-byte[], simply because BB's extra fields are
so big.
That is,
bq. A HeapByteBuffer wastes a lot of memory compared to a byte[] (5 more ints,
a long, and a boolean).
also goes for DirectByteBuffer (those fields are all declared in ByteBuffer
that HBB and DBB extend).
> Time to switch back to byte[] internally?
> -----------------------------------------
>
> Key: CASSANDRA-5020
> URL: https://issues.apache.org/jira/browse/CASSANDRA-5020
> Project: Cassandra
> Issue Type: Improvement
> Components: Core
> Reporter: Jonathan Ellis
> Fix For: 2.0
>
>
> We switched to ByteBuffer for column names and values back in 0.7, which gave
> us a short term performance boost on mmap'd reads, but we gave that up when
> we switched to refcounted sstables in 1.0. (refcounting all the way up the
> read path would be too painful, so we copy into an on-heap buffer when
> reading from an sstable, then release the reference.)
> A HeapByteBuffer wastes a lot of memory compared to a byte[] (5 more ints, a
> long, and a boolean).
> The hard problem here is how to do the arena allocation we do on writes,
> which has been very successful in reducing STW CMS from heap fragmentation.
> ByteBuffer is a good fit there.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira