RFR: 8317698: Optimization for URLEncoder
Claes Redestad
redestad at openjdk.org
Sun Oct 8 20:38:13 UTC 2023
On Fri, 6 Oct 2023 20:55:40 GMT, 温绍锦 <duke at openjdk.org> wrote:
> @cl4es and @Glavo have already made some very good optimizations to URLEncoder, but we can continue to improve.
>
> 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%.
I think this is a step in the wrong direction, duplicating code from a shared utility class in order to get a marginal improvement.
Could you instead analyze *why* this is a win and then see if we can improve the utility class (`ImmutableBitSetPredicate`) instead?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/16082#issuecomment-1752155763
More information about the net-dev
mailing list