Optimization for URLEncoder

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Won't Fix
    • Priority: P4
    • None
    • Affects Version/s: 22
    • Component/s: core-libs
    • None

      This is on behalf of wenshao .

      The current URLEncoder's Predicate for DONT_NEED_ENCODING is based on BitSet, which is actually a table lookup. The actual performance may not be as good as microbench.

      The character value range of DONT_NEED_ENCODING is between [45-122]. We can construct two long type constants to do the work of BitSet. This can improve performance by about 7% to 30%.

      PR: https://github.com/openjdk/jdk/pull/16082

            Assignee:
            Unassigned
            Reporter:
            Jie Fu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: