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

Benedict commented on CASSANDRA-9989:
-------------------------------------

Thanks Jay.  The patch looks good overall, but I have few improvement comments, 
and some questions:

# How did you arrive at your {{childrenNum}} calculation, and are we certain it 
is correct?  This is pretty critical for correctness, and hard to test fully, 
so it would be nice to have some comments justifying it.
# Why decrement {{left}} instead of just counting up the number of values 
written?
# Why is TREE_SIZE indexed from 1, not 0?
# It would be nice if we removed MAX_DEPTH, and just truncated TREE_SIZE to the 
correct maximum in our static block

I'm also torn on the splitting of the last two nodes - this is consistent with 
the current {{NodeBuilder}} logic, but it does complicate the code a little 
versus evenly splitting the remaining size amongst all the children.

I've pushed a patch 
[here|https://github.com/belliottsmith/cassandra/tree/9989-suggest] with some 
tweaks to the {{LongBTreeTest}} to stress the new code paths more more, and it 
would be great if we could run this against the final patch for a while, with a 
tweak to the parameters to increase further the ratio of tests that use this 
code path.

> Optimise BTree.Buider
> ---------------------
>
>                 Key: CASSANDRA-9989
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-9989
>             Project: Cassandra
>          Issue Type: Sub-task
>            Reporter: Benedict
>            Assignee: Jay Zhuang
>            Priority: Minor
>             Fix For: 4.x
>
>         Attachments: 9989-trunk.txt
>
>
> BTree.Builder could reduce its copying, and exploit toArray more efficiently, 
> with some work. It's not very important right now because we don't make as 
> much use of its bulk-add methods as we otherwise might, however over time 
> this work will become more useful.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to