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

Optimize URLEncoder

XMLWordPrintable

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

      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.

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

              Created:
              Updated:
              Resolved: