[ https://issues.apache.org/jira/browse/SOLR-912?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12658114#action_12658114 ]
Kay Kay commented on SOLR-912: ------------------------------ System.arrayCopy is great. It is bound to perform much better because of the native code for the same. Meanwhile - w.r.t resize() - ( trade-off because increasing size a lot would increase memory usage. increase a size by a smaller factor would be resulting in a more frequent increases in size). I believe reading some theory that the ideal increase factor is somewhere close to ( 1 + 2^0.5) / 2 or something similar to that. The method - ensureCapacity(capacity) in ArrayList (Java 6) also seems to be a number along the lines ~ (1.5) int newCapacity = (oldCapacity * 3)/2 + 1; +1 seems to be move away from 0, and keep incrementing the count. ( Hmm .. That piece of code - in Java 6 ArrayList can definitely make use of bitwise operators for the div-by-2 operation !!). > org.apache.solr.common.util.NamedList - Typesafe efficient variant - > ModernNamedList introduced - implementing the same API as NamedList > ---------------------------------------------------------------------------------------------------------------------------------------- > > Key: SOLR-912 > URL: https://issues.apache.org/jira/browse/SOLR-912 > Project: Solr > Issue Type: Improvement > Components: search > Affects Versions: 1.4 > Environment: Tomcat 6, JRE 6, Solr 1.3+ nightlies > Reporter: Kay Kay > Priority: Minor > Fix For: 1.4 > > Attachments: NLProfile.java, SOLR-912.patch > > Original Estimate: 72h > Remaining Estimate: 72h > > The implementation of NamedList - while being fast - is not necessarily > type-safe. I have implemented an additional implementation of the same - > ModernNamedList (a type-safe variation providing the same interface as > NamedList) - while preserving the semantics in terms of ordering of elements > and allowing null elements for key and values (keys are always Strings , > while values correspond to generics ). -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.