2 ms·
One common thing I've seen is an attempt to de-duplicate a poorly-crafted cache. Let's say you have a cache with Map<Language, BusinessInfo>. After a while, th
by jlmorton 4y ago
One common thing I've seen is an attempt to de-duplicate a poorly-crafted cache.
Let's say you have a cache with Map<Language, BusinessInfo>. After a while, the cache is quite large, and you want to reduce its memory usage. You realize within BusinessInfo, you have a MailingAddress, but it's not actually localized. You're duplicating millions of address lines for no reason.
You could split this out of your cache, but pulling that thread is a bit tricky. Instead, you decide to store addressLine.intern().