I am using a ResourceBundle and Locale to lookup property values. Quite simply, the code looks like this:
public static String getPropertyValue(Locale locale, String resourceName, String key) {
ResourceBundle resource = ResourceBundle.getBundle(resourceName, locale);
return resource.getString(key);
}
My question is about performance. Would a caching approach be quicker or a better implementation than accessing property files on the classpath? My understanding is that ResourceBundle performance is very good in general.
The properties file (in this case) is fewer than 30 lines (i.e., ~30 key/value pairs).
I question the performance since we could use a similar approach on high-load pages, and the lookup-on-demand approach might prove costly.