-
Enhancement
-
Resolution: Won't Fix
-
P5
-
None
-
1.1.5
-
x86
-
windows_95
Name: bb33257 Date: 12/04/97
Locale.equals is called in many places. It can be sped up in
the following ways:
1. use String.intern on all of the fields of the Locale in
all construction. Then equals becomes:
if (language != other.language) return false;
... instead of using equals.
2. Then speed up performance-sensitive comparisons like in
String.toUpperCase:
if (locale.getLanguage().equals("tr")) {
by adding API:
boolean isChildOf(Locale other)
which can utilize == on the fields of locale.
3. Introduce Locale.intern (following the same mechanism as
String.intern). Make all of the constants such as Locale.CANADA, plus
Locale.getDefault use the intern mechanism. This will make
common equality comparisons faster.
======================================================================
I've filed item #1 above as a separate bug, #4112433, because unlike #2
and #3 it does not require an API change and can be implemented in a
dot dot release.
laura.werner@eng 1998-02-13