lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nicholas Paldino (JIRA)" <j...@apache.org>
Subject [jira] Commented: (LUCENENET-292) Optimization of EquatableList<T>
Date Sun, 22 Nov 2009 00:39:39 GMT

    [ https://issues.apache.org/jira/browse/LUCENENET-292?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12781078#action_12781078
] 

Nicholas Paldino commented on LUCENENET-292:
--------------------------------------------

George,

Should a new patch be made, or was that statement for future reference?

If so, should the optimization be left out?  I ask because given that performance is a tenant
of Lucene.NET (as it is in Java), and because this will not affect the call site of code that
uses this class, it would seem natural for all of it to be included.

If not, then the previous sentence is moot. =)

- Nick

> Optimization of EquatableList<T>
> --------------------------------
>
>                 Key: LUCENENET-292
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-292
>             Project: Lucene.Net
>          Issue Type: Improvement
>            Reporter: Nicholas Paldino
>            Priority: Minor
>         Attachments: EquatableList3.patch, SupportClass.patch
>
>
> When comparing two IEnumerable<T> implementations, a shortcut can be taken to check
to see if both IEnumerable<T> expose operations which returns a count of items (sequences
cannot be equal if the number of elements in the sequences are not equal).
> Typically, in .NET, this is expressed through the implementation of the ICollection or
ICollection<T> interface.
> Before enumerating through each element and comparing the two for equality, if the counts
are accessible, they should be compared to see if the number of elements in the two sequences
are equal.  If a comparison is able to be made before enumerating, it will be much more performant
for comparisons of sequences where each is ~N, but both are not equal to N, and N is very
large.
> Patch to follow.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message