You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Earwin Burrfoot (JIRA)" <ji...@apache.org> on 2009/04/19 17:24:47 UTC

[jira] Updated: (LUCENE-1607) String.intern() faster alternative

     [ https://issues.apache.org/jira/browse/LUCENE-1607?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Earwin Burrfoot updated LUCENE-1607:
------------------------------------

    Attachment: intern.patch

> String.intern() faster alternative
> ----------------------------------
>
>                 Key: LUCENE-1607
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1607
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Earwin Burrfoot
>             Fix For: 2.9
>
>         Attachments: intern.patch
>
>
> By using our own interned string pool on top of default, String.intern() can be greatly optimized.
> On my setup (java 6) this alternative runs ~15.8x faster for already interned strings, and ~2.2x faster for 'new String(interned)'
> For java 5 and 4 speedup is lower, but still considerable.

-- 
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


Re: [jira] Updated: (LUCENE-1607) String.intern() faster alternative

Posted by Chris Miller <ch...@kbcfp.com>.
The implementation of Interner doesn't look threadsafe to me. At the very 
least shouldn't 'pool' be marked volatile, otherwise the result of 'pool 
= newPool' is not guaranteed to be visible to other threads?

> [
> https://issues.apache.org/jira/browse/LUCENE-1607?page=com.atlassian.j
> ira.plugin.system.issuetabpanels:all-tabpanel ]
> 
> Earwin Burrfoot updated LUCENE-1607:
> ------------------------------------
> Attachment: intern.patch
> 
>> String.intern() faster alternative
>> ----------------------------------
>> Key: LUCENE-1607
>> URL: https://issues.apache.org/jira/browse/LUCENE-1607
>> Project: Lucene - Java
>> Issue Type: Improvement
>> Reporter: Earwin Burrfoot
>> Fix For: 2.9
>> Attachments: intern.patch
>> 
>> By using our own interned string pool on top of default,
>> String.intern() can be greatly optimized.
>> 
>> On my setup (java 6) this alternative runs ~15.8x faster for already
>> interned strings, and ~2.2x faster for 'new String(interned)'
>> 
>> For java 5 and 4 speedup is lower, but still considerable.
>> 




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