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

Uwe Schindler commented on LUCENE-7382:
---------------------------------------

Sorry, it's not realy slow, it just uses more memory and produces more objects. 
We have the "generic" one for all use cases of AttributeFactory, where we don't 
handle with Tokens, e.g. FuzzyQuery's term enums or other use cases. And there 
are many!

The Token-specific one is just more efficient memory and speed-wise for 
TokenStreams - and because of that it is defined there. It just optimizes the 
case of standard token attributes like term, offsets, positions,... Otherwise 
it inherits/delegates to the default - so we still need the default.

> Wrong default attribute factory in use
> --------------------------------------
>
>                 Key: LUCENE-7382
>                 URL: https://issues.apache.org/jira/browse/LUCENE-7382
>             Project: Lucene - Core
>          Issue Type: Bug
>    Affects Versions: master (7.0), 6.2
>            Reporter: Terry Smith
>            Assignee: Uwe Schindler
>             Fix For: 6.2
>
>         Attachments: LUCENE-7382.patch
>
>
> Originally reported to the mailing list: 
> http://mail-archives.apache.org/mod_mbox/lucene-java-user/201607.mbox/%3cCAJ0VynnMAH7N7byPevTV9Htxo-Nk-B7mwUwRgP4X8gN=v4p...@mail.gmail.com%3e
> LUCENE-7355 made a change to CustomAnalyzer.createComponents() such that it 
> uses a different AttributeFactory. 
> https://github.com/apache/lucene-solr/commit/e92a38af90d12e51390b4307ccbe0c24ac7b6b4e#diff-b39a076156e10aa7a4ba86af0357a0feL122
> The previous default was TokenStream.DEFAULT_TOKEN_ATTRIBUTE_FACTORY which 
> uses PackedTokenAttributeImpl while the new default is now 
> AttributeFactory.DEFAULT_ATTRIBUTE_FACTORY which does not use 
> PackedTokenAttributeImpl.
> [~thetaphi] Asked me to open an issue for this.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to