RFR: 8035424: (reflect) Performance problem in sun.reflect.generics.parser.SignatureParser

Andrej Golovnin andrej.golovnin at gmail.com
Wed Nov 30 07:38:59 UTC 2016


Hi Peter,

I know it is matter of taste, but don't you think this:

 269         for (char c = current();
 270                c != ';' && c != '.' && c != '/' && c != '[' &&
 271                c != ':' && c != '>' && c != '<' &&
 272                !Character.isWhitespace(c);
 273              c = current())
 274         {

is easier to read than the long or-condition which is then negated?

Best regards,
Andrej Golovnin

On Tue, Nov 29, 2016 at 11:41 PM, Peter Levart <peter.levart at gmail.com> wrote:
> Hi Claes,
>
> On 11/29/2016 11:30 PM, Peter Levart wrote:
>>
>>
>>
>>
>> http://cr.openjdk.java.net/~plevart/jdk9-dev/8035424_SignatureParser.performance/webrev.02/
>>
>
> Which loop do you prefer. The above one or the following?
>
>     private void skipIdentifier() {
>         char c;
>         while (!((c = current()) == ';' || c == '.' || c == '/' ||
>                  c == '[' || c == ':' || c == '>' || c == '<' ||
>                  Character.isWhitespace(c))) {
>             advance();
>         }
>     }
>
>
> Peter
>


More information about the core-libs-dev mailing list