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

Benedict Elliott Smith commented on CASSANDRA-15511:
----------------------------------------------------

Had a quick skim through the patch, and noted a handful of things we might want 
to address:

# The new {{UpdateFunction.retain}} method doesn't need to be declared in the 
interface, and can live solely in {{ColumnData.Reconciler}} - this is helpful 
since we don't use {{retain}} in {{BTree.update}} which might be surprising 
semantically to users in future. It means we also don't have to rename 
{{UpdateFunction.insert}} if we don't want to, and can avoid allocating lambdas 
to invoke it.
# I think in {{ColumnData.Reconciler}} we probably don't need to expunge 
records from the existing tree if the existing active deletion supersedes the 
new one.
# I think there has been an accidental removal of an {{updateF}} parameter when 
copying from the {{insert}} tree, on which we should probably be invoking 
{{updateF.insert}} still in this branch.

> Utilising BTree Improvements
> ----------------------------
>
>                 Key: CASSANDRA-15511
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-15511
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Local/Other
>            Reporter: Benedict Elliott Smith
>            Assignee: Benedict Elliott Smith
>            Priority: Normal
>             Fix For: 4.0.x, 4.x
>
>         Attachments: atomicbtreepartition.ods, atomicbtreepartition.xlsx.zip, 
> perfsh.tar.gz
>
>
> This patch utilises CASSANDRA-15510 to improve throughput and reduce garbage 
> produced by a number of common operations, by employing 
> {{transformAndFilter}}, {{transform}} and {{FastBuilder}}
> * {{Row}}, {{Cell}} and {{ComplexColumnData}} cloning are implemented with 
> {{BTree.transform}}, so no special builders are necessary; 
> ** {{Rows.copy}} removed
> * {{Rows.merge}} implemented using {{BTree.update}} and a {{ColumnData}} 
> reconciler
> ** Zero-allocations if result of merge is same as {{existing}}
> ** Fewer comparisons
> * {{ColumnData}} reconciler implemented in same manner
> ** {{Cells.reconcileComplex}} is retired
> ** {{ComplexColumnData}} reconciliation now
> *** Garbage-free if the merge has no effect
> *** Always fewer allocations
> *** Fewer comparisons
> * {{FastBuilder}} employed widely:
> ** {{ClusteringIndexNamesFilter}} deserialization
> ** {{Columns}} deserialization
> ** {{PartitionUpdate}} deserialization
> ** {{AbstractBTreePartition}} construction
> ** Misc others
> The upshot of this work when combined with the proposed patch for 
> CASSANDRA-15367 has a dramatic impact on operations over collection types - 
> under contention, as much as 100x improved throughput, and hundreds of 
> megabytes of reduced allocations.  For all operations, allocations under 
> contention and no contention are significantly reduced and throughput 
> improved.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

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

Reply via email to