[10] RFR: 8184665: Skip name and alias checks for standard Charsets
Roger Riggs
Roger.Riggs at Oracle.com
Fri Jul 14 16:25:38 UTC 2017
Hi Claes,
Using == with references always looks a bit suspicious in the source
code, especially strings.
Since the first thing in equals() is the identity check, I'd suggest
using .equals for the comparisons.
Roger
On 7/14/2017 8:52 AM, Claes Redestad wrote:
> Hi,
>
> by special-casing the three Charsets we always load on startup in the
> Charset
> constructor we can avoid some superfluous checks and get a tiny startup
> improvement (~7k less bytecode executed, which is fast approaching 1%
> of total
> on minimal startup tests).
>
> Webrev: http://cr.openjdk.java.net/~redestad/8184665/jdk.00/
> Bug: https://bugs.openjdk.java.net/browse/JDK-8184665
>
> Thanks!
>
> /Claes
More information about the core-libs-dev
mailing list