You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gaurav Agarwal (JIRA)" <ji...@apache.org> on 2016/05/31 05:56:12 UTC

[jira] [Comment Edited] (CSV-184) CSVRecord toMap Method(LoadFactor for HashMap)

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

Gaurav Agarwal edited comment on CSV-184 at 5/31/16 5:55 AM:
-------------------------------------------------------------

<code>putIn</code>method takes a <code>Map</code> with initial size as size of all values in a row with and load factor 0.75.

Inside <code>putIn</code> method, we do <code>map.put</code> for all the values. Every time we put a value in <code>Hashmap</code>, it checks if <code>HashMap</code> has reached it's threshold limit(capacity * loadfactor) which will always get breached(once per row) as we are setting size as values size and load factor 0.75.

Please let me know if I am missing something.


was (Author: gaurav.agarwal):
putIn method takes a Map with initial size as size of all values in a row with and load factor 0.75.

Inside putIn method, we do map.put for all the values. Every time we put a value in Hashmap, it checks if HashMap has reached it's threshold limit(capacity * loadfactor) which will always get breached(once per row) as we are setting size as values size and load factor 0.75.

Please let me know if I am missing something.

> CSVRecord toMap Method(LoadFactor for HashMap)
> ----------------------------------------------
>
>                 Key: CSV-184
>                 URL: https://issues.apache.org/jira/browse/CSV-184
>             Project: Commons CSV
>          Issue Type: Improvement
>          Components: Parser
>    Affects Versions: 1.4
>            Reporter: Gaurav Agarwal
>            Priority: Minor
>
> Set loadFactor for Hashmap Object to 1(Default : 0.75) as currently it will always resize the map when we are putting entries in it.



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