You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Benedict (JIRA)" <ji...@apache.org> on 2015/09/14 19:53:46 UTC

[jira] [Commented] (CASSANDRA-10316) Improve ColumnDefinition comparison performance

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

Benedict commented on CASSANDRA-10316:
--------------------------------------

I forgot that we'd already half done this, by introducing a {{prefixComparison}} to {{ColumnIdentifier}}, however at the time I wasn't entirely clear what the {{position}} variable was for, and so left a huge amount of space for it.

This patch shrinks that down to permit at most 4K clustering columns. This is far far in excess of anything necessary (and we can double it again if we need, or more). It then takes the first 6 bytes of the {{prefixComparison}} and appends it to the {{comparisonOrder}}, so that we do not need to go to the {{ColumnIdentifier}} at all most of the time.

> Improve ColumnDefinition comparison performance
> -----------------------------------------------
>
>                 Key: CASSANDRA-10316
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-10316
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Benedict
>            Assignee: Benedict
>             Fix For: 3.0.x
>
>
> We have already improved the performance here for the basic comparison, however since these happen exceedingly frequently we may as well go a little (easy step) further. This is a really tiny patch, and we should aim to include before GA, but not RC.
> Right now we use all of an int for the metadata presorting, but in fact we only need 2-3 bytes for this. We can upcast the int to a long, and use the remaining bits to store the prefix of the _name_. This way, a majority of comparisons become a single long comparison. Which will be considerably cheaper.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)