Dismal performance of String.intern()

Florian Weimer fweimer at redhat.com
Tue Jun 11 07:19:23 UTC 2013

On 06/11/2013 01:01 AM, Steven Schlansker wrote:
> Sorry to double-reply, but I thought it worthwhile to note that the time to intern strings via ConcurrentHashMap is measured in the low double-digit nanoseconds on my machine, so this may indeed end up being nontrivial.  But I will consider it trivial unless I can measure it to be large.

Wouldn't the more suitable comparison be a weak hash map?  Interned 
strings are still subject to garbage collection, after all.

Florian Weimer / Red Hat Product Security Team

More information about the core-libs-dev mailing list