3 ms·
Sync on a string is a bad to boot. It's hard to explain how terrible the idea to synchronize/lock objects you don't control. As for interning (not for strings
by xxs 7y ago
Sync on a string is a bad to boot.
It's hard to explain how terrible the idea to synchronize/lock objects you don't control.
As for interning (not for strings only and not guaranteed) I have a lock free table (not CHM) that keeps most used objects (with possible random eviction) to provide a good trade off between unnecessary memory waste, fast access and low memory footprint.