[
https://issues.apache.org/jira/browse/CASSANDRA-20034?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17893874#comment-17893874
]
Benjamin Lerer commented on CASSANDRA-20034:
--------------------------------------------
The patch looks good to me.
> Consider reintroducing RestrictionSet#iterator() optimization around
> multi-column restrictions
> ----------------------------------------------------------------------------------------------
>
> Key: CASSANDRA-20034
> URL: https://issues.apache.org/jira/browse/CASSANDRA-20034
> Project: Cassandra
> Issue Type: Bug
> Components: Legacy/CQL, Legacy/Local Write-Read Paths
> Reporter: Caleb Rackliffe
> Assignee: Caleb Rackliffe
> Priority: Normal
> Fix For: 5.x
>
> Attachments: getFunctions_50.png, getFunctions_trunk.png,
> getPartitionKeys_50.png, getPartitionKeys_trunk.png
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> Before CASSANDRA-19341, {{RestrictionSet#iterator()}} only worried about
> eliminating duplicate restrictions when multi-column restrictions were
> present. After that refactor, we always create a new {{LinkedHashSet}} to
> wrap the {{SingleRestriction}} values, and this is observable in allocation
> profiles for any write-heavy workload. (See attached flame graphs.)
> Specifically, we can see the extra allocations from codepaths starting at
> {{ModificationStatement#addFunctionsTo()}} and
> {{ModificationStatement#getMutations()}}.
> We could fix this problem by simply reintroducing the
> {{hasMultiColumnRestrictions}} flag in {{RestrictionSet}}, but then we have
> to decide whether to also reintroduce {{DistinctIterator}} or leave it out
> and continue to use {{LinkedHashSet}}. Perhaps multi-column restrictions are
> not common enough to worry about it, but {{HashMap}} nodes and entries are
> not free, and this is a hot path.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]