[
https://issues.apache.org/jira/browse/LUCENE-1607?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Yonik Seeley updated LUCENE-1607:
---------------------------------
Attachment: LUCENE-1607.patch
Here's a slightly updated patch (javadoc and StringHelper.intern() convenience
method).
The method of plugging a different StringInterner implementation would be to
simply assign to the static in StringHelper.
{code}
/**
* Expert:
* The StringInterner implementation used by Lucene.
* This should never be changed after other Lucene APIs have been used.
*/
public static StringInterner interner = new SimpleStringInterner(1024,8);
{code}
Are people comfortable with this approach? How about the defaults? This
should speed up anyone with under thousands of field, and only slightly slow
down someone with over thousands of fields (until they plugged in a new
interner with a bigger table size).
> 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, LUCENE-1607.patch, LUCENE-1607.patch,
> LUCENE-1607.patch, LUCENE-1607.patch, LUCENE-1607.patch, LUCENE-1607.patch,
> LUCENE-1607.patch, LUCENE-1607.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: [email protected]
For additional commands, e-mail: [email protected]