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

Performance fallback with LTR/RTL embedding handling

XMLWordPrintable

      FULL PRODUCT VERSION :
      java version "1.7.0-ea"
      Java(TM) SE Runtime Environment (build 1.7.0-ea-b107)
      Java HotSpot(TM) 64-Bit Server VM (build 19.0-b05, mixed mode)

      Also reproduced under JDK 1.6. There is no such problem in JDK 1.5

      ADDITIONAL OS VERSION INFORMATION :
      Linux home 2.6.31-22-generic #63-Ubuntu SMP Thu Aug 19 00:23:50 UTC 2010 x86_64 GNU/Linux
      Darwin home 10.4.1 Darwin Kernel Version 10.4.1: Wed May 12 21:36:54 PDT 2010; root:xnu-1504.7.50~2/RELEASE_I386 i386


      A DESCRIPTION OF THE PROBLEM :
      JEditorPane shows text with LTR/RTL embedding chars(\u202a,\u202b,\202c) much slower. Even if LTR-only chars emedded in LTR component.



      JDK 1.5 doesn't have this problem

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Just add text with LTR/RTL embedded chars into JEditorPane

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Expected performance like in JDK 1.5, or without LTR/RTL embedded chars.
      ACTUAL -
      JDK 1.7,1.6 require less than one second for display the same text without LTR/RTL embeding chars, but with these chars it required:
      ~11 seconds on JDK 1.7 and JDK 1.6 on Linux
      ~38 seconds on JDK 1.6 on Apple's Mac Mini

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import javax.swing.*;

      public class test {
          public static void main(String[] args) throws Exception {

              StringBuilder text = new StringBuilder();
              for (int i = 0; i < 10000; i++) {
                  text.append("\u202a this is test for embedded LTR/RTL \u202c\n");
              }

              JFrame f = new JFrame();

              final JEditorPane e = new JEditorPane();

              long st = System.currentTimeMillis();
              e.setText(text.toString());
              long en = System.currentTimeMillis();
              System.out.println("Time=" + (en - st) + "ms");

              f.setContentPane(e);
              f.pack();
              f.setSize(800, 700);
              f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

              f.setVisible(true);
          }
      }

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

            rupashka Pavel Porvatov (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: