Re: [PATCH] Some improvements for java.lang.Class

2019-04-08 Thread Tagir Valeev
Hello! As an author of the IDE inspection in question I should mention that there's slight difference between for(int i=0; i= 0. So totally mechanical replacement should work fine, but may produce some amount of unnecessary Math.max and deciding whether to keep or remove them requires thinking.

Re: [PATCH] Some improvements for java.lang.Class

2019-04-08 Thread Vicente Romero
Hi Sergei, I have created issue [1] to track your enhancement. Please cc me in your next mails I will be helping you to do the paperwork. Talking about that did you sign the OCA, [2]? Thanks, Vicente [1] https://bugs.openjdk.java.net/browse/JDK-8222151 [2] https://www.oracle.com/technetwork/

Re: [PATCH] Some improvements for java.lang.Class

2019-04-06 Thread Сергей Цыпанов
It' seems messages sent from Yandex Mail mobile application are not delivered, so I repeat it from web app. --- Hello, Yes I’m willing to take this As I understand there is the code imported from 3rd party projects which shouldn’t be touched. I know only about jdk.int

Re: [PATCH] Some improvements for java.lang.Class

2019-04-03 Thread Brian Goetz
I agree that getting rid of the append(concatenation) is a good move regardless; that’s just wasteful movement. The rest of the patch seems harmless. As to applying the refactor more broadly, there’s a risk of recreating the “append(concatenation)” problem, where the concatenation is hidden

Re: [PATCH] Some improvements for java.lang.Class

2019-03-29 Thread Vicente Romero
Hi, From the benchmark data, it seems that the patched code is not a lot much faster than the original code, plus as Peter mentioned java.base is not compiled with the -XDstringConcat=inline option, so there is no way the compiler will generate any indy for the patched code. The new code is m

Re: [PATCH] Some improvements for java.lang.Class

2019-03-26 Thread Сергей Цыпанов
Hello Peter, I was unaware of mentioned detail (thank you a lot for pointing that out, it made me read the whole JEP280 again) so I've rebenchmarked my changes compiled with -XDstringConcat=inline. 1) as of Class::getTypeName for Object[] it turned out, that String::repeat performs slightly be

Re: [PATCH] Some improvements for java.lang.Class

2019-03-20 Thread Peter Levart
Hi Sergei, I don't know if you are aware that the new invokedynamic based translation of string concatenation expressions introduced in JDK 9 (http://openjdk.java.net/jeps/280) only applies to code outside java.base module. java.base module is still compiled with old-style StringBuilder based

Re: [PATCH] Some improvements for java.lang.Class

2019-03-20 Thread Сергей Цыпанов
I had a brief conversation with Brian Goetz which has left off the mailing list for some reason. Here's the text: --- Brian: These enhancements seem reasonable; these are exactly the cases that String::repeat was intended for. (This is a “is this a reasonable idea” revi