[ https://issues.apache.org/jira/browse/HBASE-15493?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15205757#comment-15205757 ]
stack commented on HBASE-15493: ------------------------------- bq. ... do not want to spend a lot of time on this easy fix I don't either. The 'fix' is for timeseries usecase at expense of others; e.g. loadings with many columns.. now they do an extra few resizings... they slow down. What about above suggestion of histogram of sizings... over a period of time. We need it all over the hbase codebase. There is a related attempt in the BoundedByteBufferPool. > Default ArrayList size may not be optimal for Mutation > ------------------------------------------------------ > > Key: HBASE-15493 > URL: https://issues.apache.org/jira/browse/HBASE-15493 > Project: HBase > Issue Type: Improvement > Components: Client, regionserver > Affects Versions: 2.0.0 > Reporter: Vladimir Rodionov > Assignee: Vladimir Rodionov > Fix For: 2.0.0 > > Attachments: HBASE-15493-v1.patch > > > {code} > List<Cell> getCellList(byte[] family) { > List<Cell> list = this.familyMap.get(family); > if (list == null) { > list = new ArrayList<Cell>(); > } > return list; > } > {code} > Creates list of size 10, this is up to 80 bytes per column family in mutation > object. > Suggested: > {code} > List<Cell> getCellList(byte[] family) { > List<Cell> list = this.familyMap.get(family); > if (list == null) { > list = new ArrayList<Cell>(CELL_LIST_INITIAL_CAPACITY); > } > return list; > } > {code} > CELL_LIST_INITIAL_CAPACITY = 2 in the patch, this is debatable. For mutation > where every CF has 1 cell, this gives decent reduction in memory allocation > rate in both client and server during write workload. ~2%, not a big number, > but as I said, already, memory optimization will include many small steps. -- This message was sent by Atlassian JIRA (v6.3.4#6332)