Optimize URLEncoder

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 22
    • Affects Version/s: None
    • Component/s: 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.

            Assignee:
            Claes Redestad
            Reporter:
            Zixian Cai
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: