You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Woody Anderson (JIRA)" <ji...@apache.org> on 2010/07/18 05:10:50 UTC

[jira] Created: (LUCENE-2545) improve uses of StringHelper.intern in Field,AbstractField, NumericField etc.

improve uses of StringHelper.intern in Field,AbstractField, NumericField etc.
-----------------------------------------------------------------------------

                 Key: LUCENE-2545
                 URL: https://issues.apache.org/jira/browse/LUCENE-2545
             Project: Lucene - Java
          Issue Type: Improvement
          Components: Other
    Affects Versions: 3.0.2
            Reporter: Woody Anderson
             Fix For: 4.0, 3.0.2


There are many times for certain field types that intern is still called when it is not needed. We can improve this with pretty simple open up of the constructors etc.

-- 
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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] Issue Comment Edited: (LUCENE-2545) improve uses of StringHelper.intern in Field,AbstractField, NumericField etc.

Posted by "Uwe Schindler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-2545?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12889586#action_12889586 ] 

Uwe Schindler edited comment on LUCENE-2545 at 7/18/10 4:26 AM:
----------------------------------------------------------------

For trunk the usage of intern() may be removed completely from Lucene, as fields are now decoupled from terms (its a separate thing in index).

Some pachanges in the patch may help for 3.x branch (not 3.0!), but we should not expose APIs to the outside that accept a "intern" boolean parameter (e.g. Field, AbstractField, NumericField).

      was (Author: thetaphi):
    For trunk the usage of intern() may be removed completely from Lucene, as fields are now decoupled from terms (its a separate thing in index).

Some pachanges in the patch may help for 3.x branch (not 3.0!), but we should not expose APIs to the outside that accept a "intern" boolean parameter (e.g. NumericField).
  
> improve uses of StringHelper.intern in Field,AbstractField, NumericField etc.
> -----------------------------------------------------------------------------
>
>                 Key: LUCENE-2545
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2545
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Other
>    Affects Versions: 3.0.2
>            Reporter: Woody Anderson
>             Fix For: 3.1, 4.0
>
>         Attachments: LUCENE-2545.patch
>
>
> There are many times for certain field types that intern is still called when it is not needed. We can improve this with pretty simple open up of the constructors etc.

-- 
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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] Commented: (LUCENE-2545) improve uses of StringHelper.intern in Field,AbstractField, NumericField etc.

Posted by "Woody Anderson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-2545?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12889651#action_12889651 ] 

Woody Anderson commented on LUCENE-2545:
----------------------------------------

What is the working definition of "outside"?
public methods?
if those internName constructors are protected is that ok?

I dont' know enough about the 4.0 branch yet to comment about how this relates or doesn't, but for the 3.x branch, when making a lot of fields, and i know they have to be intern'd anyway, i can and do have strings that are already intern'd. I basically would have to do this anyway, but given that i can, i intern them with StringHelper and avoid the extra intern in xxxField. I would like for this to be possible, even if i am using "expert" annotated constructors etc.

I prefer not to write all my code in the lucene.document package in order to use pkg protection, but I'm sure i can write some helper methods for myself and call from my other code. Would you be more open to having this kind of exposure limited to package scope?

> improve uses of StringHelper.intern in Field,AbstractField, NumericField etc.
> -----------------------------------------------------------------------------
>
>                 Key: LUCENE-2545
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2545
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Other
>    Affects Versions: 3.0.2
>            Reporter: Woody Anderson
>             Fix For: 3.1, 4.0
>
>         Attachments: LUCENE-2545.patch
>
>
> There are many times for certain field types that intern is still called when it is not needed. We can improve this with pretty simple open up of the constructors etc.

-- 
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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] Updated: (LUCENE-2545) improve uses of StringHelper.intern in Field,AbstractField, NumericField etc.

Posted by "Woody Anderson (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-2545?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Woody Anderson updated LUCENE-2545:
-----------------------------------

    Attachment: LUCENE-2545.patch

added more constructors, so any existing use will still intern the string name.
updated FieldsReader to bypass interning for binary and lazy fields.

> improve uses of StringHelper.intern in Field,AbstractField, NumericField etc.
> -----------------------------------------------------------------------------
>
>                 Key: LUCENE-2545
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2545
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Other
>    Affects Versions: 3.0.2
>            Reporter: Woody Anderson
>             Fix For: 3.0.2, 4.0
>
>         Attachments: LUCENE-2545.patch
>
>
> There are many times for certain field types that intern is still called when it is not needed. We can improve this with pretty simple open up of the constructors etc.

-- 
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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] Commented: (LUCENE-2545) improve uses of StringHelper.intern in Field,AbstractField, NumericField etc.

Posted by "Uwe Schindler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-2545?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12889586#action_12889586 ] 

Uwe Schindler commented on LUCENE-2545:
---------------------------------------

For trunk the usage of intern() may be removed completely from Lucene, as fields are now decoupled from terms (its a separate thing in index).

Some pachanges in the patch may help for 3.x branch (not 3.0!), but we should not expose APIs to the outside that accept a "intern" boolean parameter (e.g. NumericField).

> improve uses of StringHelper.intern in Field,AbstractField, NumericField etc.
> -----------------------------------------------------------------------------
>
>                 Key: LUCENE-2545
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2545
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Other
>    Affects Versions: 3.0.2
>            Reporter: Woody Anderson
>             Fix For: 4.0
>
>         Attachments: LUCENE-2545.patch
>
>
> There are many times for certain field types that intern is still called when it is not needed. We can improve this with pretty simple open up of the constructors etc.

-- 
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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] Updated: (LUCENE-2545) improve uses of StringHelper.intern in Field,AbstractField, NumericField etc.

Posted by "Uwe Schindler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-2545?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Uwe Schindler updated LUCENE-2545:
----------------------------------

    Fix Version/s:     (was: 3.0.2)

> improve uses of StringHelper.intern in Field,AbstractField, NumericField etc.
> -----------------------------------------------------------------------------
>
>                 Key: LUCENE-2545
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2545
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Other
>    Affects Versions: 3.0.2
>            Reporter: Woody Anderson
>             Fix For: 4.0
>
>         Attachments: LUCENE-2545.patch
>
>
> There are many times for certain field types that intern is still called when it is not needed. We can improve this with pretty simple open up of the constructors etc.

-- 
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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org