Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4071298

java.lang.Locale.getDefault() is a public static

XMLWordPrintable

    • 1.1.6
    • sparc
    • solaris_2.5.1
    • Verified



        Name: sv38254 Date: 08/12/97


        java.lang.Locale.getDefault() is a public static
        synchronzied method. This means it is a bottle neck for the
        WHOLE VM. This is totally unacceptable for high-end,
        high-performance server-side Java processes. This is totally unnecessary...

        e.g. the source code is currently

            public static synchronized Locale getDefault() {
                if (defaultLocale == null) {
        String language = System.getProperty("user.language", "EN");
        String region = System.getProperty("user.region", "");

        defaultLocale = new Locale(language, region);
        }
                return defaultLocale;
            }

        You could recode this so the whole method is not synchronized and when you determine that the defaultLocale
        is null then peform an internal synchronization

        This should make things much better.

        You really have to examine all the APIs so they are not
        so Applet centric. This sort of coding style is not a problem when you're running a couple of applets - but if
        you are running hundreds of simulatenous threads (which we do on the server-side) then this sort of bottleneck is a nightmare.
        ======================================================================

              bcbeck Brian Beck (Inactive)
              duke J. Duke
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: