Why only literal strings saved in the intern pool by default?
The short answer: interning literal strings is cheap at runtime and saves memory. Interning non-literal strings is expensive at runtime and therefore saves a tiny amount of memory in exchange for making the common cases much slower. The cost of the interning-strings-at-runtime “optimization” does not pay for the benefit, and is therefore not actually an … Read more