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

javax.swing.text.html.parser.Parser parseScript incorrectly optimized

    XMLWordPrintable

Details

    • b124
    • x86_64
    • windows_7

    Backports

      Description

        FULL PRODUCT VERSION :
        java version "1.8.0_45"
        Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
        Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)

        ADDITIONAL OS VERSION INFORMATION :
        Microsoft Windows [Version 6.1.7601]


        A DESCRIPTION OF THE PROBLEM :
        Parsing an HTML-page containing large scripts (with comments) is painfully slow after updating to Java 8.

        Parsing a page that took <1s before now takes >5minutes!

        Looking at the difference between Jav 7 and Java 8 versions the culprit is most likely the "optimization" added. (Adding 'insideComment' and keeping it up to date by repeatedly copying the whole string looks like a *very* bad idea).

        REGRESSION. Last worked in version 7u80

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        Code inspection should be enought to see that this is an issue.

        But otherwise prepare a Parser.parse request targeting for example http://site.soccer.betfair.com/Menu.do?timeZone=Europe/Stockholm&region=GBR&brand=betfair&locale=sv


        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        The HTML being parsed in a few seconds.
        ACTUAL -
        The HTML being parsed, but you have to get a cup of coffee before it is done (5-7 minutes on my machine).

        REPRODUCIBILITY :
        This bug can be reproduced always.

        Attachments

          Issue Links

            Activity

              People

                mcherkas Mikhail Cherkasov (Inactive)
                webbuggrp Webbug Group
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: