[
https://issues.apache.org/jira/browse/SOLR-912?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12657299#action_12657299
]
Hoss Man commented on SOLR-912:
-------------------------------
If i'm understanding the discussion so far...
* 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)
do i have those aspects correct?
with that in mind: i'm not sure i understand what "itch" changing the
implementation "scratches" ... the initial issue description says it's because
NamedList " is not necessarily type-safe" but it's not clear what that
statement is referring to ... later comments suggest that the motivation is to
improve the performance of "remove" ... which hardly seems like something worth
optimizing for.
I agree that having the internals based on a "list of pairs" certainly seems
like it might be more intuitive to developers looking at the internals (then
the current approach is), but how is the current approach less type safe for
consumers using just the NamedList API?
If the "modern" approach is more performant then the existing impl and passes
all of the tests then i suppose it would make sense to switch -- but i'm far
more interested in how the performance compares for common cases
(add/get/iterate) then for cases that hardly ever come up (remove).
My suggestion: provide two independent attachments. One patch that just
replaces the internals of NamedList with the approach you suggest so people can
apply the patch, test it out, and verify the API/behavior; A second attachment
that provides some benchmarks against the NmaedList class -- so people can
read/run your benchmark with and with out the patch to see how the performance
changes.
> 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: 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.