JDK-6280517 : Performance: Using ResourceBundle.Control API to speed up the resource bundle search
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.util:i18n
  • Affected Version: 6
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2005-06-03
  • Updated: 2010-04-02
  • Resolved: 2005-07-06
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6 b43Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
Due to the current ResourceBundle seach mechanism, after the base bundle found, a list of locale specific resource bundle has to be located, e.g. resourceX_en.class (if not found, resource_X.property will be searched).

Most of time, these locale specific resource bundle do not exists and the side effect of doing the search of non-existent resources will result into the opening of every jar file on bootclasspath and extention classpath. 

We could speed up the above process by using the ResourceBundle.Control API available in 1.6 to provide a list of locales we known for sure exists and we ONLY search these locale specific resource bundle. Some experiments show doing this will give us a great improvement on cold startup, at least on Windows platform.

###@###.### 2005-06-03 23:40:43 GMT

Comments
EVALUATION The fix is to use ResourceBundle.Control API to control the search of AWT and Swing resources which is used most often by most client applications. We added a list of locales in Defs.gmk which we supported, but don't have corresponding resources files. Then we override getCandidateLocales in Control to remove all these locales so that ResourceBundle code won't try to locate these non-existent resources from all of jar files in JRE. ###@###.### 2005-06-24 01:14:32 GMT
24-06-2005

SUGGESTED FIX During GUI app startup, usually sun.awt.resources.awt and couple swing resources file is requested, we could make a fairly small ResourceBundle.Control object to speed the search of these resources files. Since these resources files have common localized versions (11 standard locale specific version for these resources), we could override getCandidateLocales method in the ResourceBundle.Control for them. ###@###.### 2005-06-03 23:54:39 GMT
03-06-2005