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

REGRESSION: URLEncoder degraded performance in a multithreaded environment

XMLWordPrintable

    • mantis
    • generic, x86, sparc
    • generic, linux, solaris, solaris_8, windows_2000



      Name: gm110360 Date: 08/02/2002


      FULL PRODUCT VERSION :
      Solaris 64-bit:

      java version "1.4.0_01"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0_01-b03)
      Java HotSpot(TM) Client VM (build 1.4.0_01-b03, mixed mode)

      (The problem also appears in he 32-bit JDK).

      Linux:

      java version "1.4.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
      Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)


      FULL OPERATING SYSTEM VERSION :
      SunOS averia 5.8 Generic_108528-09 sun4u sparc SUNW,UltraAX-i2

      ADDITIONAL OPERATING SYSTEMS :
      Linux fora 2.4.18 #3 dl jun 3 14:55:25 CEST 2002 i686
      unknown unknown GNU/Linux


      A DESCRIPTION OF THE PROBLEM :
      URLEncoder.encode shows severely degraded performance when
      run concurrently by several threads.


      REGRESSION. Last worked in version 1.3.1

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Run the attached program under 1.4.1_02.

      Using the 2-parameter encode() method will show similar
      results (although you won't be able to compare with 1.3.1's
      behaviour).

      You can also observe this by trying to run a multi-threaded
      test on Jakarta JMeter. See
      http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11369 for
      details.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      Expected:

      $ time ~/jdk1.3.1/bin/java URLEncode

      real
      0m2.424s
      user
      0m1.040s
      sys
      0m0.100s

      Actual:

      $ time ~/j2sdk1.4.0/bin/java URLEncode

      real
      0m12.108s
      user
      0m5.330s
      sys
      0m0.290s


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      public class URLEncode extends Thread {
        public static void main(String args[]) {
          for (int i=0; i<10; i++) {
            new URLEncode().start();
          }
        }

        public void run() {
          for (int i=0; i<1000; i++) {
            String e= java.net.URLEncoder.encode("Aix? ?s una prova.");
          }
        }
      }


      ---------- END SOURCE ----------

      Release Regression From : 1.3.1_04
      The above release value was the last known release where this
      bug was known to work. Since then there has been a regression.

      (Review ID: 160216)
      ======================================================================

            michaelm Michael McMahon
            gmanwanisunw Girish Manwani (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: