lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yonik Seeley (JIRA)" <>
Subject [jira] Commented: (LUCENE-1607) String.intern() faster alternative
Date Mon, 20 Apr 2009 21:22:47 GMT


Yonik Seeley commented on LUCENE-1607:

bq. In no-collision resolution scheme, if you detect a collision early with hashcode, you
still call String.intern(). 

In the old code, yes... that's why I left it commented out there.  In the latest code, we
re-probe on a collision w/o calling compareTo (assuming hashCodes are unequal) and only call
intern() if it's really a String we haven't seen before.  The new code is a real hash table
that will store all the Strings requested through it, unlike the first variant that was a
simple cache.

> String.intern() faster alternative
> ----------------------------------
>                 Key: LUCENE-1607
>                 URL:
>             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,
> By using our own interned string pool on top of default, String.intern() can be greatly
> 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:
For additional commands, e-mail:

View raw message