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

JEditorPane setText 2MB HTML ---> Terrible Performance !!! (65 seconds)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P4 P4
    • 8-pool
    • 7
    • client-libs

      FULL PRODUCT VERSION :
      jre7u2

      ADDITIONAL OS VERSION INFORMATION :
      Same problem on Mac OS X Lion, Windows 7 and Debian GNU/LINUX squeeze .

      A DESCRIPTION OF THE PROBLEM :
      I'm trying to load an HTML file that is large approximately 2MB (1927KB for the sake of precision) into a JEditorPane, and it takes about 65 seconds, it seems to be a bug of the JTextPane/JEditorPane.

      I got these loading times result :

      Set the html content(1927KB) of the Preview pane, loading time=68230ms
      Set the html content(1927KB) of the Preview pane, loading time=62693ms
      Set the html content(1927KB) of the Preview pane, loading time=66583ms

      More Information here : http://stackoverflow.com/questions/9046365/jeditorpane-settext-2mb-html-terrible-performance-65-seconds

      and here :

      https://forums.oracle.com/forums/thread.jspa?threadID=2340546&tstart=0

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      - Load and html of 2mb or more into a string
      - set as a content of a JEditorPane with setText() method.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The same HTML file loaded into a web browser get loaded in less than 2 seconds.

      65 seconds to load 2Mb of html is too much .
      ACTUAL -
      JEditorPane take near 65 seconds to load the html string into the pane ... Too much time .

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      final String htmlContent = //Load a 2MB String
      previewPane.setContentType("text/html; charset=UTF-8");
      previewPane.setText(htmlContent);
      ---------- END SOURCE ----------

      SUPPORT :
      YES

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: