RFR: 8255299: Drop explicit zeroing at instantiation of Atomic* objects

2020-10-23 Thread Сергей Цыпанов
As discussed in https://github.com/openjdk/jdk/pull/510 there is never a reason to explicitly instantiate any instance of `Atomic*` class with its default value, i.e. `new AtomicInteger(0)` could be replaced with `new AtomicInteger()` which is faster: @State(Scope.Thread) @OutputTimeUnit(TimeUni

Re: RFR: 8255299: Drop explicit zeroing at instantiation of Atomic* objects

2020-10-23 Thread Сергей Цыпанов
On Fri, 23 Oct 2020 09:12:15 GMT, Daniel Fuchs wrote: >> As discussed in https://github.com/openjdk/jdk/pull/510 there is never a >> reason to explicitly instantiate any instance of `Atomic*` class with its >> default value, i.e. `new AtomicInteger(0)` could be replaced with `new >> AtomicInte

RFR: 8255477: Remove unused method URL.set(String protocol, String host, int port, String file, String ref)

2020-10-27 Thread Сергей Цыпанов
Hello, while working with `java.net.URL` I've found unused package-private method `URL.set(String protocol, String host, int port, String file, String ref)` which can be safely removed from JDK. Testing: tier1, tier2 Could someone crate an issue for tracking of this simple change? -

Re: RFR: 8255477: Remove unused method URL.set(String protocol, String host, int port, String file, String ref)

2020-10-27 Thread Сергей Цыпанов
On Tue, 27 Oct 2020 19:26:04 GMT, Aleksey Shipilev wrote: >> Hello, while working with `java.net.URL` I've found unused package-private >> method `URL.set(String protocol, String host, int port, String file, String >> ref)` which can be safely removed from JDK. Testing: tier1, tier2 >> >> Coul

Re: RFR: 8255299: Drop explicit zeroing at instantiation of Atomic* objects [v2]

2020-10-28 Thread Сергей Цыпанов
On Sat, 24 Oct 2020 23:12:09 GMT, Phil Race wrote: >> Сергей Цыпанов has updated the pull request with a new target base due to a >> merge or a rebase. The incremental webrev excludes the unrelated changes >> brought in by the merge/rebase. The pull request contains one add

Re: RFR: 8255299: Drop explicit zeroing at instantiation of Atomic* objects [v2]

2020-10-28 Thread Сергей Цыпанов
citValue avgt 30 11.846 ± 0.273 ns/op > So meanwhile https://bugs.openjdk.java.net/browse/JDK-8145948 is still in > progress we could trivially replace explicit zeroing with default > constructors gaining some performance benefit with no risk. > > I've tested the changes locally, both tier1 an

Re: RFR: 8255299: Drop explicit zeroing at instantiation of Atomic* objects [v2]

2020-10-28 Thread Сергей Цыпанов
On Wed, 28 Oct 2020 08:49:38 GMT, Sergey Bylokhov wrote: >> Rebased onto master to have the fix introduced in >> https://github.com/openjdk/jdk/pull/778 > > FYI it is better to use merge, instead of rebase+force push. Rebase breaks > history and all existed code comments. @mrserb thanks for po

Integrated: 8255299: Drop explicit zeroing at instantiation of Atomic* objects

2020-10-28 Thread Сергей Цыпанов
On Thu, 22 Oct 2020 20:46:15 GMT, Сергей Цыпанов wrote: > As discussed in https://github.com/openjdk/jdk/pull/510 there is never a > reason to explicitly instantiate any instance of `Atomic*` class with its > default value, i.e. `new AtomicInteger(0)` could be replaced

Re: RFR: 8255477: Remove unused method URL.set(String protocol, String host, int port, String file, String ref)

2020-11-25 Thread Сергей Цыпанов
On Wed, 25 Nov 2020 08:02:07 GMT, Aleksey Shipilev wrote: >> @shipilev thanks for filing the issue! Done. > > Please merge from master to get a fresh round of testing. @AlanBateman might > want to look at it. Done! - PR: https://git.openjdk.java.net/jdk/pull/779

Re: RFR: 8255477: Remove unused method URL.set(String protocol, String host, int port, String file, String ref) [v2]

2020-11-25 Thread Сергей Цыпанов
f this simple change? Сергей Цыпанов has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains two additional commits since the last revision: - Merge bran

Re: RFR: 8255477: Remove unused method URL.set(String protocol, String host, int port, String file, String ref)

2020-11-26 Thread Сергей Цыпанов
On Wed, 25 Nov 2020 13:31:06 GMT, Daniel Fuchs wrote: >> Done! > > I'll have a look at this when I can spare some cycles. @stsypanov did you run > tier2 tests? @dfuch Recent run has some errors: java/net/MulticastSocket/SetOutgoingIf.java: Re-test IPv6 (and specifically MulticastSocket) with

Integrated: 8255477: Remove unused method URL.set(String protocol, String host, int port, String file, String ref)

2020-12-14 Thread Сергей Цыпанов
On Wed, 21 Oct 2020 06:52:42 GMT, Сергей Цыпанов wrote: > Hello, while working with `java.net.URL` I've found unused package-private > method `URL.set(String protocol, String host, int port, String file, String > ref)` which can be safely removed from JDK. Testing: tier1, ti

Re: RFR: 8080272 Refactor I/O stream copying to use java.io.InputStream.transferTo [v8]

2020-12-21 Thread Сергей Цыпанов
On Mon, 21 Dec 2020 09:16:11 GMT, Andrey Turbanov wrote: >> 8080272 Refactor I/O stream copying to use java.io.InputStream.transferTo > > Andrey Turbanov has updated the pull request incrementally with one > additional commit since the last revision: > > 8080272: Refactor I/O stream copying

Re: RFR: 8080272 Refactor I/O stream copying to use java.io.InputStream.transferTo [v8]

2020-12-21 Thread Сергей Цыпанов
On Mon, 21 Dec 2020 09:51:25 GMT, Andrey Turbanov wrote: >> src/java.base/share/classes/sun/security/tools/keytool/Main.java line 2459: >> >>> 2457: byte[] bytes = in.readAllBytes(); >>> 2458: return >>> CertificateFactory.getInstance("X509").generateCRLs( >>> 2

RFR: 8259699: Reduce char[] copying in URLEncoder.encode(String, Charset)

2021-01-13 Thread Сергей Цыпанов
Instead of allocating a copy of underlying array via `CharArrayWriter.toCharArray()` and passing it to constructor of String String str = new String(charArrayWriter.toCharArray()); we could call `toString()` method String str = charArrayWriter.toString(); decoding existing char[] without making a

Re: RFR: 8259699: Reduce char[] copying in URLEncoder.encode(String, Charset)

2021-01-13 Thread Сергей Цыпанов
On Sun, 10 Jan 2021 20:13:51 GMT, Attila Szegedi wrote: >> Instead of allocating a copy of underlying array via >> `CharArrayWriter.toCharArray()` and passing it to constructor of String >> String str = new String(charArrayWriter.toCharArray()); >> we could call `toString()` method >> String str

Re: RFR: 8259699: Reduce char[] copying in URLEncoder.encode(String, Charset)

2021-01-13 Thread Сергей Цыпанов
On Wed, 13 Jan 2021 13:48:40 GMT, Claes Redestad wrote: >> Instead of allocating a copy of underlying array via >> `CharArrayWriter.toCharArray()` and passing it to constructor of String >> String str = new String(charArrayWriter.toCharArray()); >> we could call `toString()` method >> String str

Re: RFR: 8259699: Reduce char[] copying in URLEncoder.encode(String, Charset)

2021-01-14 Thread Сергей Цыпанов
On Wed, 13 Jan 2021 13:48:40 GMT, Claes Redestad wrote: >> Instead of allocating a copy of underlying array via >> `CharArrayWriter.toCharArray()` and passing it to constructor of String >> String str = new String(charArrayWriter.toCharArray()); >> we could call `toString()` method >> String str

Re: RFR: 8259699: Reduce char[] copying in URLEncoder.encode(String, Charset) [v2]

2021-01-14 Thread Сергей Цыпанов
> 0.006 ± 0.001 MB/sec > UrlEncoderBenchmark.encodeUtf8:·gc.churn.G1_Survivor_Space.norm avgt 100 > 0.010 ± 0.002B/op > UrlEncoderBenchmark.encodeUtf8:·gc.count avgt 100 > 655.000 counts > UrlEncoderBenchmark.encodeUtf8:·gc.time

Re: RFR: 8259699: Reduce char[] copying in URLEncoder.encode(String, Charset) [v3]

2021-01-14 Thread Сергей Цыпанов
> 0.006 ± 0.001 MB/sec > UrlEncoderBenchmark.encodeUtf8:·gc.churn.G1_Survivor_Space.norm avgt 100 > 0.010 ± 0.002B/op > UrlEncoderBenchmark.encodeUtf8:·gc.count avgt 100 > 655.000 counts > UrlEncoderBenchmark.encodeUtf8:·gc.time

Re: RFR: 8259699: Reduce char[] copying in URLEncoder.encode(String, Charset) [v3]

2021-01-14 Thread Сергей Цыпанов
On Wed, 13 Jan 2021 13:48:40 GMT, Claes Redestad wrote: >> Сергей Цыпанов has updated the pull request with a new target base due to a >> merge or a rebase. The incremental webrev excludes the unrelated changes >> brought in by the merge/rebase. The pull request contai

Integrated: 8259699: Reduce char[] copying in URLEncoder.encode(String, Charset)

2021-01-14 Thread Сергей Цыпанов
On Thu, 3 Dec 2020 14:29:58 GMT, Сергей Цыпанов wrote: > Instead of allocating a copy of underlying array via > `CharArrayWriter.toCharArray()` and passing it to constructor of String > String str = new String(charArrayWriter.toCharArray()); > we could call `toString()` method

RFR: 8261880: Change nested classes in java.base to static nested classes where possible

2021-02-17 Thread Сергей Цыпанов
Non-static classes hold a link to their parent classes, which in many cases can be avoided. - Commit messages: - 8261880: Change nested classes in java.base to static nested classes where possible Changes: https://git.openjdk.java.net/jdk/pull/2589/files Webrev: https://webrevs.o

Re: RFR: 8261880: Change nested classes in java.base to static nested classes where possible [v2]

2021-02-17 Thread Сергей Цыпанов
On Wed, 17 Feb 2021 16:24:46 GMT, Claes Redestad wrote: >> Сергей Цыпанов has updated the pull request incrementally with one >> additional commit since the last revision: >> >> 8261880: Remove static from declarations of Holder nested classes > > src/java.base/

Re: RFR: 8261880: Change nested classes in java.base to static nested classes where possible [v2]

2021-02-17 Thread Сергей Цыпанов
> Non-static classes hold a link to their parent classes, which in many cases > can be avoided. Сергей Цыпанов has updated the pull request incrementally with one additional commit since the last revision: 8261880: Remove static from declarations of Holder nested c

Re: RFR: 8261880: Change nested classes in java.base to static nested classes where possible [v2]

2021-02-25 Thread Сергей Цыпанов
On Wed, 24 Feb 2021 08:50:36 GMT, Alan Bateman wrote: >> Сергей Цыпанов has updated the pull request incrementally with one >> additional commit since the last revision: >> >> 8261880: Remove static from declarations of Holder nested classes > > src/java.b

Re: RFR: 8263560: Remove needless wrapping with BufferedInputStream

2021-03-14 Thread Сергей Цыпанов
On Sun, 14 Mar 2021 07:51:24 GMT, Alan Bateman wrote: >> In some cases wrapping of `InputStream` with `BufferedInputStream` is >> redundant, e.g. in case the wrapped one is `ByteArrayOutputStream` which >> does not require any buffer having one within. >> >> Other cases are related to reading

RFR: 8263560: Remove needless wrapping with BufferedInputStream

2021-03-14 Thread Сергей Цыпанов
In some cases wrapping of `InputStream` with `BufferedInputStream` is redundant, e.g. in case the wrapped one is `ByteArrayOutputStream` which does not require any buffer having one within. Other cases are related to reading either a byte or short `byte[]`: in both cases `BufferedInputStream.fi

Re: RFR: 8263561: Re-examine uses of LinkedList

2021-03-14 Thread Сергей Цыпанов
On Fri, 26 Feb 2021 15:32:57 GMT, liach wrote: > Are linked lists worse for addition even in cases where addition to array > list or deque requires resize and copying? i thought that's the advantage of > linked list. As far as I know `LinkedList` is always worse than `ArrayList` and discourag

RFR: 8263561: Re-examine uses of LinkedList

2021-03-14 Thread Сергей Цыпанов
The usage of `LinkedList` is senseless and can be replaced with either `ArrayList` or `ArrayDeque` which are both more compact and effective. jdk:tier1 and jdk:tier2 are both ok - Commit messages: - Remove remaining usages of LinkedList in java.base Changes: https://git.openjdk.ja

Re: RFR: 8263561: Re-examine uses of LinkedList

2021-03-14 Thread Сергей Цыпанов
On Sun, 14 Mar 2021 15:02:03 GMT, liach wrote: >> src/java.base/share/classes/jdk/internal/loader/URLClassPath.java line 220: >> >>> 218: return Collections.emptyList(); >>> 219: } >>> 220: List result = new ArrayList<>(); >> >> We'd better be cautious about this re

Re: RFR: 8263560: Remove needless wrapping with BufferedInputStream [v2]

2021-03-14 Thread Сергей Цыпанов
n both > cases `BufferedInputStream.fill()` will be called resulting in load of much > bigger amount of data (8192 by default) than required. Сергей Цыпанов has updated the pull request incrementally with one additional commit since the last revision: Revert usage of InputStream.readNBytes() -

Re: RFR: 8263560: Remove needless wrapping with BufferedInputStream [v2]

2021-03-14 Thread Сергей Цыпанов
On Sun, 14 Mar 2021 11:16:13 GMT, Alan Bateman wrote: >> Сергей Цыпанов has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Revert usage of InputStream.readNBytes() > > src/java.base/share/classes/jdk/inter

Re: RFR: 8263561: Re-examine uses of LinkedList

2021-03-14 Thread Сергей Цыпанов
On Sun, 14 Mar 2021 17:26:07 GMT, Alan Bateman wrote: >> Looks like it's never specified in JavaDoc which particular implementation >> of List is used in fields of affected classes, so it's quite odd to me that >> someone would rely on that when using reflection. But your point about >> backwa

Re: RFR: 8263560: Remove needless wrapping with BufferedInputStream [v3]

2021-03-14 Thread Сергей Цыпанов
On Sun, 14 Mar 2021 17:40:27 GMT, Alan Bateman wrote: >> It turned out, that with this latest update some of tier2_tools tests are >> failing, e.g. `JLinkNegativeTest`: >> test JLinkNegativeTest.testMalformedJmod(): failure >> java.lang.AssertionError: Output does not fit regexp: Error: >> java

Re: RFR: 8263560: Remove needless wrapping with BufferedInputStream [v3]

2021-03-14 Thread Сергей Цыпанов
n both > cases `BufferedInputStream.fill()` will be called resulting in load of much > bigger amount of data (8192 by default) than required. Сергей Цыпанов has updated the pull request incrementally with one additional commit since the last revision: Use InputStream.readNBytes() and

Re: RFR: 8263560: Remove needless wrapping with BufferedInputStream [v3]

2021-03-15 Thread Сергей Цыпанов
On Sun, 14 Mar 2021 22:48:18 GMT, Sergey Bylokhov wrote: >> Сергей Цыпанов has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Use InputStream.readNBytes() and fix JLinkNegativeTest > > src/java.deskt

Re: RFR: 8263560: Remove needless wrapping with BufferedInputStream [v4]

2021-03-15 Thread Сергей Цыпанов
n both > cases `BufferedInputStream.fill()` will be called resulting in load of much > bigger amount of data (8192 by default) than required. Сергей Цыпанов has updated the pull request incrementally with one additional commit since the last revision: Fix formatting - Ch

Re: RFR: 8263560: Remove needless wrapping with BufferedInputStream [v5]

2021-03-15 Thread Сергей Цыпанов
n both > cases `BufferedInputStream.fill()` will be called resulting in load of much > bigger amount of data (8192 by default) than required. Сергей Цыпанов has updated the pull request incrementally with one additional commit since the last revision: Fix error message - Ch

Re: RFR: 8263560: Remove needless wrapping with BufferedInputStream [v5]

2021-03-15 Thread Сергей Цыпанов
On Mon, 15 Mar 2021 11:41:07 GMT, Alan Bateman wrote: >> Done > >> Done > > I think I'd prefer if the exception message would say that the JMOD is > invalid or that the JMOD file is truncated (because I don't think anyone > seeing this exception will know anything about the header). Fixed --

Re: RFR: 8263560: Remove needless wrapping with BufferedInputStream [v5]

2021-03-15 Thread Сергей Цыпанов
On Mon, 15 Mar 2021 15:04:49 GMT, Daniel Fuchs wrote: >> Сергей Цыпанов has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Fix error message > > src/java.base/share/classes/sun/net/www/http/HttpC

Re: RFR: 8263560: Remove needless wrapping with BufferedInputStream [v6]

2021-03-15 Thread Сергей Цыпанов
n both > cases `BufferedInputStream.fill()` will be called resulting in load of much > bigger amount of data (8192 by default) than required. Сергей Цыпанов has updated the pull request incrementally with one additional commit since the last revision: Revert HttpClient - Ch

Integrated: 8263560: Remove needless wrapping with BufferedInputStream

2021-03-29 Thread Сергей Цыпанов
On Sat, 13 Mar 2021 22:29:23 GMT, Сергей Цыпанов wrote: > In some cases wrapping of `InputStream` with `BufferedInputStream` is > redundant, e.g. in case the wrapped one is `ByteArrayOutputStream` which does > not require any buffer having one within. > > Other cases are rel

RFR: 8264896: Remove redundant '& 0xFF' from int-to-byte cast

2021-04-08 Thread Сергей Цыпанов
When we do byte b1 = (byte) (value & 0xFF); we keep from int only 1 lower byte and exactly the same can be achieved with plain cast. See the test below: public class Main { public static void main(String[] args) throws Exception { IntStream.range(Integer.MIN_VALUE, Integer.MAX_VALUE).forEach

Re: RFR: 8263561: Re-examine uses of LinkedList

2021-04-08 Thread Сергей Цыпанов
On Mon, 15 Mar 2021 06:56:00 GMT, Alan Bateman wrote: >> Nothing outside of the JDK should be hacking into this private field of a >> non-exposed class, this should not be a concern here. > >> @AlanBateman so is it ok to keep `ArrayLists`? > > One thing to look out for is usages of 2-arg add me

Re: RFR: 8261880: Change nested classes in java.base to static nested classes where possible [v2]

2021-05-19 Thread Сергей Цыпанов
On Wed, 17 Feb 2021 16:38:03 GMT, Сергей Цыпанов wrote: >> Non-static classes hold a link to their parent classes, which in many cases >> can be avoided. > > Сергей Цыпанов has updated the pull request incrementally with one additional > commit since the last revision: &

Re: RFR: 8261880: Change nested classes in java.base to static nested classes where possible [v2]

2021-05-20 Thread Сергей Цыпанов
On Thu, 20 May 2021 10:42:49 GMT, Claes Redestad wrote: >> Сергей Цыпанов has updated the pull request incrementally with one >> additional commit since the last revision: >> >> 8261880: Remove static from declarations of Holder nested classes > > Marked as

Integrated: 8261880: Change nested classes in java.base to static nested classes where possible

2021-05-20 Thread Сергей Цыпанов
On Tue, 16 Feb 2021 14:30:58 GMT, Сергей Цыпанов wrote: > Non-static classes hold a link to their parent classes, which in many cases > can be avoided. This pull request has now been integrated. Changeset: 9425d3de Author:Sergey Tsypanov Committer: Claes Redestad URL:

Re: RFR: 8263561: Re-examine uses of LinkedList

2021-05-21 Thread Сергей Цыпанов
On Fri, 26 Feb 2021 10:48:33 GMT, Сергей Цыпанов wrote: > The usage of `LinkedList` is senseless and can be replaced with either > `ArrayList` or `ArrayDeque` which are both more compact and effective. > > jdk:tier1 and jdk:tier2 are both ok Hi guys, any more comments here? Pleas

Re: RFR: 8263561: Re-examine uses of LinkedList

2021-05-24 Thread Сергей Цыпанов
On Fri, 21 May 2021 14:15:53 GMT, Daniel Fuchs wrote: >> The usage of `LinkedList` is senseless and can be replaced with either >> `ArrayList` or `ArrayDeque` which are both more compact and effective. >> >> jdk:tier1 and jdk:tier2 are both ok > > src/java.base/share/classes/jdk/internal/util/j

Re: RFR: 8263561: Re-examine uses of LinkedList

2021-05-24 Thread Сергей Цыпанов
On Fri, 21 May 2021 14:18:16 GMT, Daniel Fuchs wrote: >> The usage of `LinkedList` is senseless and can be replaced with either >> `ArrayList` or `ArrayDeque` which are both more compact and effective. >> >> jdk:tier1 and jdk:tier2 are both ok > > src/java.base/share/classes/jdk/internal/util/j

Re: RFR: 8263561: Re-examine uses of LinkedList

2021-05-24 Thread Сергей Цыпанов
On Fri, 21 May 2021 15:12:20 GMT, Thiago Henrique Hüpner wrote: >>> IcedTea-Web seems to be using this method reflectively: >>> https://github.com/AdoptOpenJDK/IcedTea-Web/blob/master/common/src/main/java/net/adoptopenjdk/icedteaweb/jdk89access/JarIndexAccess.java#L80 >> >> I assume this doesn'

Re: RFR: 8263561: Re-examine uses of LinkedList

2021-05-24 Thread Сергей Цыпанов
On Mon, 24 May 2021 09:25:08 GMT, liach wrote: >> Should we then revert the changes to `JarIndex`? > > But don't people access these internal code at their own risk, as jdk may > change these code at any time without notice? True, I just wonder whether it's OK to change internals when we know

Re: RFR: 8263561: Re-examine uses of LinkedList [v2]

2021-05-25 Thread Сергей Цыпанов
> The usage of `LinkedList` is senseless and can be replaced with either > `ArrayList` or `ArrayDeque` which are both more compact and effective. > > jdk:tier1 and jdk:tier2 are both ok Сергей Цыпанов has refreshed the contents of this pull request, and previous commits have been

Re: RFR: 8263561: Re-examine uses of LinkedList [v3]

2021-05-25 Thread Сергей Цыпанов
> The usage of `LinkedList` is senseless and can be replaced with either > `ArrayList` or `ArrayDeque` which are both more compact and effective. > > jdk:tier1 and jdk:tier2 are both ok Сергей Цыпанов has updated the pull request incrementally with one additional commit since the l

Re: RFR: 8263561: Re-examine uses of LinkedList [v4]

2021-05-25 Thread Сергей Цыпанов
> The usage of `LinkedList` is senseless and can be replaced with either > `ArrayList` or `ArrayDeque` which are both more compact and effective. > > jdk:tier1 and jdk:tier2 are both ok Сергей Цыпанов has updated the pull request with a new target base due to a merge or a

Withdrawn: 8263561: Re-examine uses of LinkedList

2021-06-02 Thread Сергей Цыпанов
On Fri, 26 Feb 2021 10:48:33 GMT, Сергей Цыпанов wrote: > The usage of `LinkedList` is senseless and can be replaced with either > `ArrayList` or `ArrayDeque` which are both more compact and effective. > > jdk:tier1 and jdk:tier2 are both ok This pull request has been closed w

RFR: 8263561: Re-examine uses of LinkedList

2021-06-02 Thread Сергей Цыпанов
After I've renamed remove branch GitHub for some reason has closed original https://github.com/openjdk/jdk/pull/2744, so I've decided to recreate it. - Commit messages: - Merge branch 'master' into 8263561 - Merge branch 'master' into purge-linked-list - 8263561: Use sized constru

Re: RFR: 8263561: Re-examine uses of LinkedList [v2]

2021-06-04 Thread Сергей Цыпанов
> After I've renamed remove branch GitHub for some reason has closed original > https://github.com/openjdk/jdk/pull/2744, so I've decided to recreate it. Сергей Цыпанов has updated the pull request with a new target base due to a merge or a rebase. The pull request now contai

RFR: 8267840: Improve URLStreamHandler.parseURL()

2021-06-18 Thread Сергей Цыпанов
There is an optimization opportunity for the widespread use-case when a resource is read from classpath using `getClass().getClassLoader().getResource()` or `getClass().getClassLoader().getResourceAsStream()`. Pay attention to lines starting from 261. In case I run something like var props = g

Re: RFR: 8267840: Improve URLStreamHandler.parseURL()

2021-06-22 Thread Сергей Цыпанов
On Fri, 18 Jun 2021 07:31:14 GMT, Сергей Цыпанов wrote: > There is an optimization opportunity for the widespread use-case when a > resource is read from classpath using > `getClass().getClassLoader().getResource()` or > `getClass().getClassLoader().getResourceAsStream()`. >

Re: RFR: 8267840: Improve URLStreamHandler.parseURL()

2021-06-23 Thread Сергей Цыпанов
On Tue, 22 Jun 2021 11:59:11 GMT, Daniel Fuchs wrote: >> There is an optimization opportunity for the widespread use-case when a >> resource is read from classpath using >> `getClass().getClassLoader().getResource()` or >> `getClass().getClassLoader().getResourceAsStream()`. >> >> Pay attenti

Re: RFR: 8267840: Improve URLStreamHandler.parseURL() [v2]

2021-06-30 Thread Сергей Цыпанов
ourceBenchmark.getResource:·gc.churn.G1_Survivor_Space avgt > 100 0,008 ± 0,005 MB/sec > ClassGetResourceBenchmark.getResource:·gc.churn.G1_Survivor_Space.norm avgt > 100 0,017 ± 0,010B/op > ClassGetResourceBenchmark.getResource:·gc.count avgt > 10070,

Re: RFR: 8263561: Re-examine uses of LinkedList [v3]

2021-06-30 Thread Сергей Цыпанов
> After I've renamed remove branch GitHub for some reason has closed original > https://github.com/openjdk/jdk/pull/2744, so I've decided to recreate it. Сергей Цыпанов has updated the pull request with a new target base due to a merge or a rebase. The pull request now contai

Re: RFR: 8267840: Improve URLStreamHandler.parseURL() [v2]

2021-07-05 Thread Сергей Цыпанов
On Fri, 2 Jul 2021 13:57:47 GMT, Daniel Fuchs wrote: >> Сергей Цыпанов has updated the pull request with a new target base due to a >> merge or a rebase. The incremental webrev excludes the unrelated changes >> brought in by the merge/rebase. The pull request contain

Re: RFR: 8267840: Improve URLStreamHandler.parseURL() [v3]

2021-07-05 Thread Сергей Цыпанов
ourceBenchmark.getResource:·gc.churn.G1_Survivor_Space avgt > 100 0,008 ± 0,005 MB/sec > ClassGetResourceBenchmark.getResource:·gc.churn.G1_Survivor_Space.norm avgt > 100 0,017 ± 0,010B/op > ClassGetResourceBenchmark.getResource:·gc.count avgt > 100

Re: RFR: 8263561: Re-examine uses of LinkedList [v4]

2021-07-08 Thread Сергей Цыпанов
> After I've renamed remove branch GitHub for some reason has closed original > https://github.com/openjdk/jdk/pull/2744, so I've decided to recreate it. Сергей Цыпанов has updated the pull request with a new target base due to a merge or a rebase. The pull request now cont

Re: RFR: 8263561: Re-examine uses of LinkedList [v5]

2021-07-26 Thread Сергей Цыпанов
> After I've renamed remove branch GitHub for some reason has closed original > https://github.com/openjdk/jdk/pull/2744, so I've decided to recreate it. Сергей Цыпанов has updated the pull request with a new target base due to a merge or a rebase. The pull request now con

Re: RFR: 8263561: Re-examine uses of LinkedList [v6]

2021-08-02 Thread Сергей Цыпанов
> After I've renamed remove branch GitHub for some reason has closed original > https://github.com/openjdk/jdk/pull/2744, so I've decided to recreate it. Сергей Цыпанов has updated the pull request with a new target base due to a merge or a rebase. The pull request now con

Integrated: 8263561: Re-examine uses of LinkedList

2021-08-02 Thread Сергей Цыпанов
On Wed, 2 Jun 2021 12:10:46 GMT, Сергей Цыпанов wrote: > After I've renamed remove branch GitHub for some reason has closed original > https://github.com/openjdk/jdk/pull/2744, so I've decided to recreate it. This pull request has now been integrated. Changeset: 249d6418 A

Re: RFR: 8267840: Improve URLStreamHandler.parseURL()

2021-08-02 Thread Сергей Цыпанов
On Wed, 23 Jun 2021 10:03:48 GMT, Сергей Цыпанов wrote: >> Hi Sergey, >> >> That exception means you're using an obsolete version of jtreg: you need >> jtreg-6+1 now. >> >> best regards, >> -- daniel > > @dfuch I've fixed the issue an

Integrated: 8267840: Improve URLStreamHandler.parseURL()

2021-08-05 Thread Сергей Цыпанов
On Fri, 18 Jun 2021 07:31:14 GMT, Сергей Цыпанов wrote: > There is an optimization opportunity for the widespread use-case when a > resource is read from classpath using > `getClass().getClassLoader().getResource()` or > `getClass().getClassLoader().getResourceAsStream()`. >

RFR: 8276166: Remove dead code from MimeTable and MimeEntry

2021-10-29 Thread Сергей Цыпанов
There are unused methods/constructors in mentioned classes that can be safely removed. - Commit messages: - 8276166: Remove dead code from MimeTable and MimeEntry Changes: https://git.openjdk.java.net/jdk/pull/6169/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=6169&r

Re: RFR: 8276166: Remove dead code from MimeTable and MimeEntry

2021-11-26 Thread Сергей Цыпанов
On Fri, 29 Oct 2021 11:20:57 GMT, Сергей Цыпанов wrote: > There are unused methods/constructors in mentioned classes that can be safely > removed. Let's wait a bit - PR: https://git.openjdk.java.net/jdk/pull/6169

RFR: 8277868: Use Comparable.compare() instead of surrogate code

2021-11-26 Thread Сергей Цыпанов
Instead of something like long x; long y; return (x < y) ? -1 : ((x == y) ? 0 : 1); we can use `return Long.compare(x, y);` All replacements are done with IDE. - Commit messages: - 8277868: Use Comparable.compare() instead of surrogate code Changes: https://git.openjdk.java.net/j

Re: RFR: 8277868: Use Comparable.compare() instead of surrogate code [v2]

2021-11-29 Thread Сергей Цыпанов
> Instead of something like > > long x; > long y; > return (x < y) ? -1 : ((x == y) ? 0 : 1); > > we can use `return Long.compare(x, y);` > > All replacements are done with IDE. Сергей Цыпанов has updated the pull request incrementally with one additional

Re: RFR: 8277868: Use Comparable.compare() instead of surrogate code [v2]

2021-11-29 Thread Сергей Цыпанов
On Sat, 27 Nov 2021 22:50:55 GMT, Michael Bien wrote: >> Сергей Цыпанов has updated the pull request incrementally with one >> additional commit since the last revision: >> >> 8277868: Use Integer.signum() in BasicTableUI > > src/java.desktop/share/

Re: RFR: 8277868: Use Comparable.compare() instead of surrogate code [v2]

2021-12-07 Thread Сергей Цыпанов
On Mon, 6 Dec 2021 17:46:22 GMT, Phil Race wrote: >> Сергей Цыпанов has updated the pull request incrementally with one >> additional commit since the last revision: >> >> 8277868: Use Integer.signum() in BasicTableUI > > src/java.desktop/share/classes/java

Re: RFR: 8277868: Use Comparable.compare() instead of surrogate code [v3]

2021-12-07 Thread Сергей Цыпанов
> Instead of something like > > long x; > long y; > return (x < y) ? -1 : ((x == y) ? 0 : 1); > > we can use `return Long.compare(x, y);` > > All replacements are done with IDE. Сергей Цыпанов has updated the pull request incrementally with one additional

Re: RFR: 8277868: Use Comparable.compare() instead of surrogate code [v2]

2021-12-07 Thread Сергей Цыпанов
On Mon, 6 Dec 2021 17:48:37 GMT, Phil Race wrote: >> Сергей Цыпанов has updated the pull request incrementally with one >> additional commit since the last revision: >> >> 8277868: Use Integer.signum() in BasicTableUI > > src/java.desktop/share/classes/

Re: RFR: 8277868: Use Comparable.compare() instead of surrogate code [v4]

2021-12-07 Thread Сергей Цыпанов
> Instead of something like > > long x; > long y; > return (x < y) ? -1 : ((x == y) ? 0 : 1); > > we can use `return Long.compare(x, y);` > > All replacements are done with IDE. Сергей Цыпанов has updated the pull request incrementally with two additional c

Re: RFR: 8277868: Use Comparable.compare() instead of surrogate code [v3]

2021-12-07 Thread Сергей Цыпанов
On Tue, 7 Dec 2021 12:01:27 GMT, Alexey Ivanov wrote: >> Сергей Цыпанов has updated the pull request incrementally with one >> additional commit since the last revision: >> >> 8277868: Inline local var > > src/java.base/share/classes/java/util/Calendar.java line

Integrated: 8277868: Use Comparable.compare() instead of surrogate code

2021-12-16 Thread Сергей Цыпанов
On Fri, 26 Nov 2021 12:46:59 GMT, Сергей Цыпанов wrote: > Instead of something like > > long x; > long y; > return (x < y) ? -1 : ((x == y) ? 0 : 1); > > we can use `return Long.compare(x, y);` > > All replacements are done with IDE. This pull request has n

Re: RFR: 8276166: Remove dead code from MimeTable and MimeEntry

2021-12-24 Thread Сергей Цыпанов
On Fri, 29 Oct 2021 11:20:57 GMT, Сергей Цыпанов wrote: > There are unused methods/constructors in mentioned classes that can be safely > removed. Not now - PR: https://git.openjdk.java.net/jdk/pull/6169

Re: RFR: 8276166: Remove dead code from MimeTable and MimeEntry

2022-01-20 Thread Сергей Цыпанов
On Wed, 19 Jan 2022 16:55:44 GMT, Julia Boes wrote: >> Not now > > Happy to /sponsor once you /integrate, @stsypanov. @FrauBoes thanks! - PR: https://git.openjdk.java.net/jdk/pull/6169

Integrated: 8276166: Remove dead code from MimeTable and MimeEntry

2022-01-20 Thread Сергей Цыпанов
On Fri, 29 Oct 2021 11:20:57 GMT, Сергей Цыпанов wrote: > There are unused methods/constructors in mentioned classes that can be safely > removed. This pull request has now been integrated. Changeset: cf977e88 Author:Sergey Tsypanov Committer: Julia Boes URL:

RFR: 8285521: Minor improvements in java.net.URI

2022-04-26 Thread Сергей Цыпанов
- use `String.equalsIgnoreCase()` instead of hand-written code relying on `String.charAt()` - use `String.compareToIgnoreCase()` instead of hand-written code relying on `String.charAt()` - drop branches that are never executed - drop unused argument from `URI.resolvePath()` - simplify String-rela

Re: RFR: 8285521: Minor improvements in java.net.URI

2022-04-26 Thread Сергей Цыпанов
On Tue, 26 Apr 2022 11:35:10 GMT, Daniel Fuchs wrote: >> - use `String.equalsIgnoreCase()` instead of hand-written code relying on >> `String.charAt()` >> - use `String.compareToIgnoreCase()` instead of hand-written code relying on >> `String.charAt()` >> - drop branches that are never executed

Re: RFR: 8285521: Minor improvements in java.net.URI

2022-04-26 Thread Сергей Цыпанов
On Tue, 26 Apr 2022 07:02:55 GMT, Сергей Цыпанов wrote: > - use `String.equalsIgnoreCase()` instead of hand-written code relying on > `String.charAt()` > - use `String.compareToIgnoreCase()` instead of hand-written code relying on > `String.charAt()` > - drop branches that are

Re: RFR: 8285521: Minor improvements in java.net.URI

2022-05-19 Thread Сергей Цыпанов
On Thu, 19 May 2022 12:19:25 GMT, ExE Boss wrote: >> - use `String.equalsIgnoreCase()` instead of hand-written code relying on >> `String.charAt()` >> - use `String.compareToIgnoreCase()` instead of hand-written code relying on >> `String.charAt()` >> - drop branches that are never executed >>

Re: RFR: 8285521: Minor improvements in java.net.URI

2022-05-20 Thread Сергей Цыпанов
On Tue, 26 Apr 2022 07:02:55 GMT, Сергей Цыпанов wrote: > - use `String.equalsIgnoreCase()` instead of hand-written code relying on > `String.charAt()` > - use `String.compareToIgnoreCase()` instead of hand-written code relying on > `String.charAt()` > - drop branches that are

Re: RFR: 8285521: Minor improvements in java.net.URI [v2]

2022-05-20 Thread Сергей Цыпанов
m `URI.resolvePath()` > - simplify String-related operations Сергей Цыпанов has updated the pull request incrementally with one additional commit since the last revision: 8285521: Revert wrong changes - Changes: - all: https://git.openjdk.java.net/jdk/pull/8397/files - new: https://git