[ https://issues.apache.org/jira/browse/SOLR-912?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12657627#action_12657627 ]
Kay Kay commented on SOLR-912: ------------------------------ | ModernNamedList is being suggested as an alternate implementation of NamedList ... ideally the internals of NamedLIst would be replaced with the internals of ModernNamedList, but in this patch they are seperate classes so they can be compared. | INamedList is included in the patch as a way to demonstrate that ModernNamedList fulfills the same contract as NamedList (for the purposes of testing etc) True. Attached herewith is: NLProfile.java - that contains sample benchmarking against the 2 implementations (will work with the previous page on the page). Some results: addAll / getAll(): increase in performance is almost [1-10]% range. add: increase in performance by around 30% , probably because of the additional growth in the List implementation when size approaches capacity. And since, in NamedList - we insert 2 elements as opposed to one, ( as done in ModernNamedList) - it might be more pronounced. iterator: ~70% increase in performance in favor of the new implementation since it just reuses the iterator for the internal data structure. The numbers should be present as comments in the corresponding methods - testAdd() , testAddAll(), testGetAll(), testIterator() . I will attach the final patch once we are convinced with the benchmark methodology and the numbers. > 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: Analysis > Affects Versions: 1.4 > Environment: Tomcat 6, JRE 6, Solr 1.3+ nightlies > Reporter: Kay Kay > Priority: Minor > Fix For: 1.3.1 > > 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.