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

Branimir Lambov commented on CASSANDRA-8988:
--------------------------------------------

Method names are the best form of documentation there is; not using them well 
is a missed opportunity.

My concrete suggestions:
- compare2: compareAsymmetric (sorry I didn't realize this is not restricted to 
intervals)
- find2: binaryBoundarySearch ('binary' lets people know its complexity and 
that it needs a sorted array immediately)
- the arguments: searchIn and searchFor are good ones
- inclusivei: acceptsEqual (or maybe lowerIncludesEqual). 'lt' could be called 
similarly ({{if (c < acceptEqual)}} is not the clearest line of code, but it 
does help understand what's going on).
- returni: selectBoundary. Might be worth renaming i, j to lower, upper as well.

Actually I also preferred the original explicit version of the code. You can go 
back to it if you want; the downside with it is that it sort of itches to be 
improved and people will waste time trying to do just that.

> Optimise IntervalTree
> ---------------------
>
>                 Key: CASSANDRA-8988
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-8988
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Benedict
>            Assignee: Benedict
>            Priority: Minor
>             Fix For: 3.0
>
>         Attachments: 8988.txt
>
>
> We perform a lot of unnecessary comparisons in 
> IntervalTree.IntervalNode.searchInternal.



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

Reply via email to