RFR: 8216403: Allocate fewer EnumSets in JavacFileManager#list
Remi Forax
forax at univ-mlv.fr
Wed Jan 9 10:38:51 UTC 2019
List.of() (with no argument) doesn't need to be stored in a static final given it's already a value stored in a static final and i'm not sure that in this case List.of(oneSingleValue) will be allocated due to escape analysis.
Rémi
----- Mail original -----
> De: "Claes Redestad" <claes.redestad at oracle.com>
> À: "Liam Miller-Cushon" <cushon at google.com>, "compiler-dev" <compiler-dev at openjdk.java.net>, "Ron Shapiro"
> <ronshapiro at google.com>
> Envoyé: Mercredi 9 Janvier 2019 10:48:12
> Objet: Re: RFR: 8216403: Allocate fewer EnumSets in JavacFileManager#list
> Hi,
>
> not really a langtools reviewer, but I generally avoid using raw
> static EnumSets due their mutable nature (not saying there's a bug
> here - just that we should consider all possible futures and treat them
> kindly).
>
> Set.of() / Set.of(FOLLOW_LINKS) is a compact, performant and safer
> alternative.
>
> Thanks!
>
> /Claes
>
> On 2019-01-09 02:44, Liam Miller-Cushon wrote:
>> Hi,
>>
>> Please consider this trivial performance improvement, which moves a
>> couple of allocations out of JavacFileManager#list.
>>
>> bug: https://bugs.openjdk.java.net/browse/JDK-8216403
>> webrev: http://cr.openjdk.java.net/~cushon/8216403/webrev.00/
>>
>> Thanks,
> > Liam
More information about the compiler-dev
mailing list