cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sylvain Lebresne (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CASSANDRA-9999) Improve usage of HashMap and HashSet in NetworkTopologyStrategy
Date Thu, 14 Jan 2016 16:53:39 GMT

     [ https://issues.apache.org/jira/browse/CASSANDRA-9999?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Sylvain Lebresne updated CASSANDRA-9999:
----------------------------------------
    Reviewer: Branimir Lambov

> Improve usage of HashMap and HashSet in NetworkTopologyStrategy
> ---------------------------------------------------------------
>
>                 Key: CASSANDRA-9999
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-9999
>             Project: Cassandra
>          Issue Type: Improvement
>            Reporter: Tommy Stendahl
>            Assignee: Tommy Stendahl
>            Priority: Minor
>         Attachments: 9999.txt
>
>
> In NetworkTopologyStrategy there are HashMaps and HashSets created with a specified initial
size. I assume that this is done avoid having them re sized then when objects are inserted
to them. Unfortunately they are created with the size of the expected number of object that
will be inserted into them. Since the default load factor is 0.75 this will almost guarantee
that HashMaps and HashSets are re sized, to avoid re size the initial size should be set to
"no of objects / 0.75 +1".
> Since this is done every time calculateNaturalEndpoints() is called this might have some
performance impact.



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

Mime
View raw message