[ 
https://issues.apache.org/jira/browse/CASSANDRA-21683?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jon Haddad updated CASSANDRA-21683:
-----------------------------------
    Description: 
When Cassandra writes a BTI SSTable, it builds a partition index: a trie that 
maps each partition key to its position on disk. To place a key in the trie, 
the builder first converts it to a byte-comparable form, a byte string that 
sorts in the same order as the key.

That conversion runs repeatedly. For each partition, the builder re-encodes the 
same one or two keys about four times: once to find where a key differs from 
its neighbour, once to cut the shared prefix, and again when the trie re-reads 
the previous key. Each encode allocates a chain of throwaway objects 
(ByteSource, Multi, varargs arrays, escapers), roughly nineteen short-lived 
objects per partition. Across a flush or compaction with millions of 
partitions, this is a large amount of garbage, and it pressures the garbage 
collector

  was:Placeholder...


> Reduce allocations in BTI writes
> --------------------------------
>
>                 Key: CASSANDRA-21683
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-21683
>             Project: Apache Cassandra
>          Issue Type: Improvement
>          Components: Local/SSTable
>            Reporter: Jon Haddad
>            Assignee: Jon Haddad
>            Priority: Normal
>
> When Cassandra writes a BTI SSTable, it builds a partition index: a trie that 
> maps each partition key to its position on disk. To place a key in the trie, 
> the builder first converts it to a byte-comparable form, a byte string that 
> sorts in the same order as the key.
> That conversion runs repeatedly. For each partition, the builder re-encodes 
> the same one or two keys about four times: once to find where a key differs 
> from its neighbour, once to cut the shared prefix, and again when the trie 
> re-reads the previous key. Each encode allocates a chain of throwaway objects 
> (ByteSource, Multi, varargs arrays, escapers), roughly nineteen short-lived 
> objects per partition. Across a flush or compaction with millions of 
> partitions, this is a large amount of garbage, and it pressures the garbage 
> collector



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to