cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aleksey Yeschenko (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (CASSANDRA-13892) Make BTree.Builder use the initialCapacity
Date Mon, 02 Oct 2017 15:10:02 GMT

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

Aleksey Yeschenko edited comment on CASSANDRA-13892 at 10/2/17 3:09 PM:
------------------------------------------------------------------------

I would probably write the second commit as
{code}
values = Arrays.copyOf(values, Math.max(count, 1) * 2);
{code}

It's slightly less branchy (sometimes) and never creates an array with one element, which
just wastes 4 bytes to padding with compressed OOPS enabled.

That said,
1. I'm not certain it's important enough to warrant committing to 3.0. The risk is low, so
I don't mind, but in spirit it might not belong to a stabilisation release. Will leave the
decision up to you.

2. What do you do with 3.11 and trunk? B/c of recycling, providing {{initialCapacity}} doesn't
quite work and fixing it requires some refactoring, which warrants extra review.

Edit: 3.0 version LGTM though, if you decide to proceed with it.


was (Author: iamaleksey):
I would probably write the second commit as
{code}
values = Arrays.copyOf(values, Math.max(count, 1) * 2);
{code}

It's slightly less branchy (sometimes) and never creates an array with one element, which
just wastes 4 bytes to padding with compressed OOPS enabled.

That said,
1. I'm not certain it's important enough to warrant committing to 3.0. The risk is low, so
I don't mind, but in spirit it might not belong to a stabilisation release. Will leave the
decision up to you.

2. What do you do with 3.11 and trunk? B/c of recycling, providing {{initialCapacity}} doesn't
quite work and fixing it requires some refactoring, which warrants extra review.

> Make BTree.Builder use the initialCapacity
> ------------------------------------------
>
>                 Key: CASSANDRA-13892
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-13892
>             Project: Cassandra
>          Issue Type: Improvement
>            Reporter: Marcus Eriksson
>            Assignee: Marcus Eriksson
>            Priority: Minor
>             Fix For: 3.0.x, 3.11.x, 4.x
>
>
> The initialCapacity passed to {{BTree.builder(comparator, initialCapacity)}} is unused,
start using it



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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


Mime
View raw message