lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simon Willnauer (JIRA)" <j...@apache.org>
Subject [jira] Commented: (LUCENE-2197) StopFilter should not create a new CharArraySet if the given set is already an instance of CharArraySet
Date Fri, 08 Jan 2010 21:37:55 GMT

    [ https://issues.apache.org/jira/browse/LUCENE-2197?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12798189#action_12798189
] 

Simon Willnauer commented on LUCENE-2197:
-----------------------------------------

bq. Sorry Simon... I think I just got fed up with stuff like this in the JDK over the years
(that forces people to write their own implementations for best performance), and you happened
to be the closest person at the time 
:) no worries, thanks for the reply!

bq. To the software pedant, that's not safe and would probably be called bad design - ...
I understand and I can totally see your point. I was kind of separated due to the kind of
short "rants" (don't get me wrong). I agree with you that we should not do that in a filter
as this constructor could be called very very frequently especially if an analyzer does not
implement reusableTokenStream. I would still argue that for an analyzer this is a different
story and I would want to keep the code in analyzers copying the set. Classes, instantiated
so frequently as filters should not introduce possible bottlenecks while analyzers are usually
shared that won't be much of a hassle - any performance police issues with this? :)

> StopFilter should not create a new CharArraySet if the given set is already an instance
of CharArraySet
> -------------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-2197
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2197
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Analysis
>    Affects Versions: 3.1
>            Reporter: Simon Willnauer
>            Priority: Critical
>             Fix For: 3.1
>
>         Attachments: LUCENE-2197.patch, LUCENE-2197.patch
>
>
> With LUCENE-2094 a new CharArraySet is created no matter what type of set is passed to
StopFilter. This does not behave as  documented and could introduce serious performance problems.
Yet, according to the javadoc, the instance of CharArraySet should be passed to CharArraySet.copy
(which is very fast for CharArraySet instances) instead of "copied" via "new CharArraySet()"

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message