JDK-8153849 : StringTable::intern(Symbol*) is inefficient
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 9
  • Priority: P3
  • Status: Closed
  • Resolution: Won't Fix
  • Submitted: 2016-04-08
  • Updated: 2018-01-02
  • Resolved: 2018-01-02
Related Reports
Relates :  
Description
StringTable::intern is a go-to way to convert Symbol* to String oop, see e.g. JDK-8151751. However, it is not very efficient, because it goes through multiple conversions: Symbol* (UTF-8) ---> jchar* (UTF-16?) --> lookup --> java.lang.String (UTF-16/Latin1).

See e.g. the profile for a proof-of-concept patch from JDK-8151751, StringTable::intern dominates there, and the hottest codepaths inside are UTF8::unicode_length and UTF8::convert_to_unicode that produce jchar* for table lookup. 

http://cr.openjdk.java.net/~shade/8153849/StringTable-intern.txt
http://cr.openjdk.java.net/~shade/8153849/Symbol-as-unicode.txt

Making a table to lookup with a Symbol* key would benefit this.
Comments
This is not on our list of current priorities. If there are additional specific customer requirements, we will consider reopening this issue. Closing as WNF.
02-01-2018