Re: [OpenJDK 2D-Dev] RFR: 8271603: Unnecessary Vector usage in java.desktop [v4]

2021-09-01 Thread Andrey Turbanov
On Fri, 27 Aug 2021 18:28:58 GMT, Sergey Bylokhov wrote: >> Can you please elaborate? >> As I can see if size of array is exactly the same as size of >> vector/arraylist, implementations are similar - they just call >> System.arraycopy >> ![изображение](https://user-images.githubusercontent.com

Re: [OpenJDK 2D-Dev] RFR: 8271603: Unnecessary Vector usage in java.desktop [v4]

2021-08-27 Thread Sergey Bylokhov
On Fri, 27 Aug 2021 17:52:19 GMT, Andrey Turbanov wrote: >> src/java.desktop/share/classes/javax/swing/JMenu.java line 1340: >> >>> 1338: } >>> 1339: MenuElement[] me = new MenuElement[elements.size()]; >>> 1340: elements.toArray(me); >> >> Implementation of the "toArra

Re: [OpenJDK 2D-Dev] RFR: 8271603: Unnecessary Vector usage in java.desktop [v4]

2021-08-27 Thread Andrey Turbanov
On Fri, 27 Aug 2021 17:04:33 GMT, Sergey Bylokhov wrote: >> Andrey Turbanov has updated the pull request incrementally with one >> additional commit since the last revision: >> >> 8271603: Unnecessary Vector usage in java.desktop >> migrate even more usages > > src/java.desktop/share/classe

Re: [OpenJDK 2D-Dev] RFR: 8271603: Unnecessary Vector usage in java.desktop [v4]

2021-08-27 Thread Sergey Bylokhov
On Wed, 25 Aug 2021 17:53:00 GMT, Andrey Turbanov wrote: >> Usage of thread-safe collection `Vector` is unnecessary. It's recommended to >> use `ArrayList` if a thread-safe implementation is not needed. In >> post-BiasedLocking times, this is gets worse, as every access is >> synchronized. >>

Re: [OpenJDK 2D-Dev] RFR: 8271603: Unnecessary Vector usage in java.desktop [v4]

2021-08-25 Thread Andrey Turbanov
> Usage of thread-safe collection `Vector` is unnecessary. It's recommended to > use `ArrayList` if a thread-safe implementation is not needed. In > post-BiasedLocking times, this is gets worse, as every access is synchronized. > I checked only places where `Vector` was used as local variable. A