Hi,

we can refactor sun.util.locale.BaseLocale+LocaleObjectCache to minimize the number of SoftReferences created in Locale::<clinit> and when looking up already defined BaseLocales inside the Locale constructor.

http://cr.openjdk.java.net/~redestad/8196869/jdk.00/

This is mainly a tiny startup optimization, dropping executed bytecode during startup by a few thousand and reducing the minimum retained heap by a few Kb, but also speeds up microbenchmarks repeatedly calling the Locale constructor by ~1.25x. Tests stressing that dereferenced Locales are disposed of promptly remain happy.

Thanks!

/Claes

Reply via email to