Dismal performance of String.intern()

Aleksey Shipilev aleksey.shipilev at oracle.com
Tue Jun 11 08:52:10 UTC 2013


On 06/11/2013 12:31 PM, Remi Forax wrote:
> On 06/10/2013 08:06 PM, Steven Schlansker wrote:
> Hi Steven,
> the main issue is that intern() doesn't work in isolation,
>
> I think it's better to change the JSON Parser implementation to use it's
> own cache (or not) and not rely on String.intern().

+1.

IMO, String.intern() is the gateway into VM symbol table, and should be
regarded as such. The improvements for String.intern(), if any, then
should be on the VM (native) side.

Also, I think most people confuse String interning and String
de-duplication. Using interning to improve memory footprint is the
overkill. Smart deduplicators may carefully balance the overheads of
deduplication vs. the memory footprint.

-Aleksey.




More information about the core-libs-dev mailing list