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

Jay Zhuang commented on CASSANDRA-9989:
---------------------------------------

There's a little bit improvement when we pre-compute the child size and split 
the left values to the last 2 nodes: 
[{{9989-2}}|https://github.com/cooldoger/cassandra/tree/9989-2]. Here is my 
benchmark test results (it should only impact the large bTree build):

{noformat}
== calculate child size every round:
     [java] Benchmark                      (dataSize)   Mode  Cnt       Score   
    Error   Units
     [java] BTreeBuildBench.buildTreeTest           1  thrpt   16  124595.864 ? 
10133.336  ops/ms
     [java] BTreeBuildBench.buildTreeTest           2  thrpt   16  120228.601 ? 
12859.617  ops/ms
     [java] BTreeBuildBench.buildTreeTest           5  thrpt   16  103881.001 ? 
 8136.400  ops/ms
     [java] BTreeBuildBench.buildTreeTest          10  thrpt   16   89141.480 ? 
 7716.011  ops/ms
     [java] BTreeBuildBench.buildTreeTest          20  thrpt   16   67390.602 ? 
 8057.348  ops/ms
     [java] BTreeBuildBench.buildTreeTest          40  thrpt   16   19633.234 ? 
 1545.773  ops/ms
     [java] BTreeBuildBench.buildTreeTest         100  thrpt   16   10334.557 ? 
 1027.898  ops/ms
     [java] BTreeBuildBench.buildTreeTest        1000  thrpt   16    1239.163 ? 
  173.303  ops/ms
     [java] BTreeBuildBench.buildTreeTest       10000  thrpt   16     104.024 ? 
   12.069  ops/ms
     [java] BTreeBuildBench.buildTreeTest      100000  thrpt   16      10.259 ? 
    1.088  ops/ms

== pre-calculate child size and split the left values to the last 2 nodes:
     [java] Benchmark                      (dataSize)   Mode  Cnt       Score   
    Error   Units
     [java] BTreeBuildBench.buildTreeTest           1  thrpt   16  122030.330 ? 
10528.782  ops/ms
     [java] BTreeBuildBench.buildTreeTest           2  thrpt   16  121939.935 ? 
12627.014  ops/ms
     [java] BTreeBuildBench.buildTreeTest           5  thrpt   16  104694.942 ? 
 9031.935  ops/ms
     [java] BTreeBuildBench.buildTreeTest          10  thrpt   16   87687.949 ? 
 9029.432  ops/ms
     [java] BTreeBuildBench.buildTreeTest          20  thrpt   16   67941.722 ? 
 7099.874  ops/ms
     [java] BTreeBuildBench.buildTreeTest          40  thrpt   16   19468.380 ? 
 1640.993  ops/ms
     [java] BTreeBuildBench.buildTreeTest         100  thrpt   16   10503.954 ? 
  980.228  ops/ms
     [java] BTreeBuildBench.buildTreeTest        1000  thrpt   16    1374.558 ? 
  167.329  ops/ms
     [java] BTreeBuildBench.buildTreeTest       10000  thrpt   16     111.364 ? 
    8.896  ops/ms
     [java] BTreeBuildBench.buildTreeTest      100000  thrpt   16      10.728 ? 
    1.107  ops/ms
{noformat}

I would prefer the clearer code.

> 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