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

TokenStream buffer should grow exponentially

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P5 P5
    • 8
    • None
    • core-libs
    • None

      This is a minor issue, but it helps improve parse time a bit for some of the larger scripts out there.

      Currently the token buffer in TokenStream grows linearly (256 elements at a time). For some scripts such as octane/pdfjs.js this requires several hundred reallocations. We can reduce this by growing the buffer exponentially, e.g. doubling its size each time.

      For pdfjs.js this reduces parse time by about 200 ms (from ca. 1240 ms down to 1040).

            hannesw Hannes Wallnoefer
            hannesw Hannes Wallnoefer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: