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

Optimize URLEncoder

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P4
    • 22
    • None
    • core-libs
    • None
    • b16
    • generic
    • generic

    Description

      JBS issue opened for https://github.com/openjdk/jdk/pull/15354

      - Avoid allocating StringBuilder when there are no characters in the URL that need to be encoded;
      - Implement a fast path for UTF-8.

      In addition to improving performance, these optimizations also reduce temporary objects:
      - It no longer allocates any object when there are no characters in the URL that need to be encoded;
      - The initial size of StringBuilder is larger to avoid expansion as much as possible;
      - For UTF-8, the temporary CharArrayWriter, strings and byte arrays are no longer needed.

      Attachments

        Issue Links

          Activity

            People

              redestad Claes Redestad
              zcai Zixian Cai
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: