Re: RFR: 8186958: Need method to create pre-sized HashMap [v22]

2022-04-18 Thread Stuart Marks
On Thu, 14 Apr 2022 21:27:16 GMT, XenoAmess wrote: >> 8186958: Need method to create pre-sized HashMap > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > java.xml.crypto's usage downgrade grammar to 1.8 I've also written a relea

Re: RFR: 8186958: Need method to create pre-sized HashMap [v22]

2022-04-18 Thread Stuart Marks
On Thu, 14 Apr 2022 21:27:16 GMT, XenoAmess wrote: >> 8186958: Need method to create pre-sized HashMap > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > java.xml.crypto's usage downgrade grammar to 1.8 Marked as reviewed by sma

Re: RFR: 8186958: Need method to create pre-sized HashMap [v21]

2022-04-18 Thread Sean Mullan
On Thu, 14 Apr 2022 20:16:38 GMT, Sean Mullan wrote: >>> Are the changes necessary for this part? >> >> @seanjmullan no, they are just performance refinement. >> >> If you really that wanna 100% sync , >> >> I can use the old 1.8 api to migrate that part, and make a mirror pr to that >> part

Re: RFR: 8186958: Need method to create pre-sized HashMap [v21]

2022-04-18 Thread Stuart Marks
On Thu, 14 Apr 2022 20:16:38 GMT, Sean Mullan wrote: >>> Are the changes necessary for this part? >> >> @seanjmullan no, they are just performance refinement. >> >> If you really that wanna 100% sync , >> >> I can use the old 1.8 api to migrate that part, and make a mirror pr to that >> part

Re: RFR: 8186958: Need method to create pre-sized HashMap [v22]

2022-04-16 Thread XenoAmess
On Thu, 14 Apr 2022 21:27:16 GMT, XenoAmess wrote: >> 8186958: Need method to create pre-sized HashMap > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > java.xml.crypto's usage downgrade grammar to 1.8 So is there any other thi

Re: RFR: 8186958: Need method to create pre-sized HashMap [v21]

2022-04-14 Thread XenoAmess
On Thu, 14 Apr 2022 19:56:22 GMT, Bradford Wetmore wrote: >> XenoAmess has updated the pull request incrementally with one additional >> commit since the last revision: >> >> add `@LastModified: Apr 2022` to DocumentCache > > src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOM

Re: RFR: 8186958: Need method to create pre-sized HashMap [v22]

2022-04-14 Thread XenoAmess
> 8186958: Need method to create pre-sized HashMap XenoAmess has updated the pull request incrementally with one additional commit since the last revision: java.xml.crypto's usage downgrade grammar to 1.8 - Changes: - all: https://git.openjdk.java.net/jdk/pull/7928/files - ne

Re: RFR: 8186958: Need method to create pre-sized HashMap [v18]

2022-04-14 Thread Naoto Sato
On Thu, 14 Apr 2022 18:32:03 GMT, Naoto Sato wrote: >>> Good point! Filed an issue: https://bugs.openjdk.java.net/browse/JDK-8284856 >> >> @stuart-marks @naotoj I can help solve JDK-8284856 after this pr. But >> usually we only solve 1 issue in 1 pr, so I think it's better to wait after >> thi

Re: RFR: 8186958: Need method to create pre-sized HashMap [v21]

2022-04-14 Thread Stuart Marks
On Thu, 14 Apr 2022 19:53:45 GMT, Bradford Wetmore wrote: >> XenoAmess has updated the pull request incrementally with one additional >> commit since the last revision: >> >> add `@LastModified: Apr 2022` to DocumentCache > > I learned something new about HashMap today... > > I looked at jav

Re: RFR: 8186958: Need method to create pre-sized HashMap [v21]

2022-04-14 Thread Sean Mullan
On Thu, 14 Apr 2022 20:11:37 GMT, XenoAmess wrote: > > Are the changes necessary for this part? > > @seanjmullan no, they are just performance refinement. > > If you really that wanna 100% sync , > > I can use the old 1.8 api to migrate that part, and make a mirror pr to that > part of https:

Re: RFR: 8186958: Need method to create pre-sized HashMap [v21]

2022-04-14 Thread XenoAmess
On Thu, 14 Apr 2022 18:10:28 GMT, XenoAmess wrote: >> 8186958: Need method to create pre-sized HashMap > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > add `@LastModified: Apr 2022` to DocumentCache > Are the changes necessary

Re: RFR: 8186958: Need method to create pre-sized HashMap [v21]

2022-04-14 Thread Sean Mullan
On Thu, 14 Apr 2022 18:10:28 GMT, XenoAmess wrote: >> 8186958: Need method to create pre-sized HashMap > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > add `@LastModified: Apr 2022` to DocumentCache Right, we generally try to

Re: RFR: 8186958: Need method to create pre-sized HashMap [v21]

2022-04-14 Thread Bradford Wetmore
On Thu, 14 Apr 2022 18:10:28 GMT, XenoAmess wrote: >> 8186958: Need method to create pre-sized HashMap > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > add `@LastModified: Apr 2022` to DocumentCache I learned something new abo

Re: RFR: 8186958: Need method to create pre-sized HashMap [v18]

2022-04-14 Thread Naoto Sato
On Thu, 14 Apr 2022 17:06:53 GMT, XenoAmess wrote: >> Good point! Filed an issue: https://bugs.openjdk.java.net/browse/JDK-8284856 > >> Good point! Filed an issue: https://bugs.openjdk.java.net/browse/JDK-8284856 > > @stuart-marks @naotoj I can help solve JDK-8284856 after this pr. But usually

Re: RFR: 8186958: Need method to create pre-sized HashMap [v20]

2022-04-14 Thread Joe Wang
On Thu, 14 Apr 2022 18:05:48 GMT, XenoAmess wrote: >> src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/DocumentCache.java >> line 3: >> >>> 1: /* >>> 2: * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights >>> reserved. >>> 3: */ >> >> The LastModified

Re: RFR: 8186958: Need method to create pre-sized HashMap [v21]

2022-04-14 Thread Joe Wang
On Thu, 14 Apr 2022 18:10:28 GMT, XenoAmess wrote: >> 8186958: Need method to create pre-sized HashMap > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > add `@LastModified: Apr 2022` to DocumentCache Marked as reviewed by joehw

Re: RFR: 8186958: Need method to create pre-sized HashMap [v20]

2022-04-14 Thread XenoAmess
On Thu, 14 Apr 2022 17:23:42 GMT, Joe Wang wrote: >> XenoAmess has updated the pull request incrementally with one additional >> commit since the last revision: >> >> revert changes on ProcessEnvironment > > src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/DocumentCache.

Re: RFR: 8186958: Need method to create pre-sized HashMap [v21]

2022-04-14 Thread XenoAmess
> 8186958: Need method to create pre-sized HashMap XenoAmess has updated the pull request incrementally with one additional commit since the last revision: add `@LastModified: Apr 2022` to DocumentCache - Changes: - all: https://git.openjdk.java.net/jdk/pull/7928/files - new:

Re: RFR: 8186958: Need method to create pre-sized HashMap [v20]

2022-04-14 Thread Joe Wang
On Thu, 14 Apr 2022 17:05:39 GMT, XenoAmess wrote: >> 8186958: Need method to create pre-sized HashMap > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > revert changes on ProcessEnvironment src/java.xml/share/classes/com/sun/or

Re: RFR: 8186958: Need method to create pre-sized HashMap [v18]

2022-04-14 Thread XenoAmess
On Wed, 13 Apr 2022 22:53:15 GMT, Naoto Sato wrote: > Good point! Filed an issue: https://bugs.openjdk.java.net/browse/JDK-8284856 @stuart-marks @naotoj I can help solve JDK-8284856 after this pr. But usually we only solve 1 issue in 1 pr, so I think it's better to wait after this. ---

Re: RFR: 8186958: Need method to create pre-sized HashMap [v20]

2022-04-14 Thread XenoAmess
> 8186958: Need method to create pre-sized HashMap XenoAmess has updated the pull request incrementally with one additional commit since the last revision: revert changes on ProcessEnvironment - Changes: - all: https://git.openjdk.java.net/jdk/pull/7928/files - new: https://g

Re: RFR: 8186958: Need method to create pre-sized HashMap [v18]

2022-04-14 Thread XenoAmess
On Wed, 13 Apr 2022 23:25:47 GMT, Stuart Marks wrote: >> XenoAmess has updated the pull request incrementally with one additional >> commit since the last revision: >> >> update LastModified > > src/java.base/unix/classes/java/lang/ProcessEnvironment.java line 102: > >> 100: /* Only for

Re: RFR: 8186958: Need method to create pre-sized HashMap [v19]

2022-04-14 Thread XenoAmess
> 8186958: Need method to create pre-sized HashMap XenoAmess has updated the pull request incrementally with one additional commit since the last revision: fix usage in XSAttributeChecker - Changes: - all: https://git.openjdk.java.net/jdk/pull/7928/files - new: https://git.op

Re: RFR: 8186958: Need method to create pre-sized HashMap [v18]

2022-04-14 Thread XenoAmess
On Thu, 14 Apr 2022 03:38:52 GMT, Joe Wang wrote: >>> I suspect the `size*2+1` was a failed attempt at allocating a HashMap of >>> the correct capacity for `size` mappings. >> >> I looked the codes and don't think so.. >> If I'm wrong, I'm glad to fix. > > Stuart's right, I looked at the code,

Re: RFR: 8186958: Need method to create pre-sized HashMap [v18]

2022-04-14 Thread Chris Hegarty
On Wed, 13 Apr 2022 22:20:14 GMT, XenoAmess wrote: >> 8186958: Need method to create pre-sized HashMap > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > update LastModified LGTM. - Marked as reviewed by chegar (Re

Re: RFR: 8186958: Need method to create pre-sized HashMap [v16]

2022-04-14 Thread Daniel Fuchs
On Wed, 13 Apr 2022 19:28:08 GMT, Stuart Marks wrote: > Reviewers for i18n, net, nio, and security, please review call site changes > in your areas. Thanks. Changes to `java.net.http` look good to me. I haven't spotted anything obviously wrong in the rest, but should defer to reviewers of thes

Re: RFR: 8186958: Need method to create pre-sized HashMap [v18]

2022-04-13 Thread Joe Wang
On Thu, 14 Apr 2022 01:13:18 GMT, XenoAmess wrote: >> src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSAttributeChecker.java >> line 1819: >> >>> 1817: Map items; >>> 1818: LargeContainer(int size) { >>> 1819: items = HashMap.newHashMap(size*2+1

Re: RFR: 8186958: Need method to create pre-sized HashMap [v18]

2022-04-13 Thread Joe Wang
On Thu, 14 Apr 2022 01:15:05 GMT, XenoAmess wrote: >> src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/DocumentCache.java >> line 171: >> >>> 169: _current = 0; >>> 170: _size = size; >>> 171: _references = HashMap.newHashMap(_size); >> >> Not `_s

Re: RFR: 8186958: Need method to create pre-sized HashMap [v18]

2022-04-13 Thread XenoAmess
On Wed, 13 Apr 2022 22:57:33 GMT, Stuart Marks wrote: > Not `_size+2` ? I don't have a idea here why he original use the + 2. Is there any guy more familiar with this code tell me why? Thanks! > I suspect the `size*2+1` was a failed attempt at allocating a HashMap of the > correct capacity for

Re: RFR: 8186958: Need method to create pre-sized HashMap [v16]

2022-04-13 Thread Naoto Sato
On Wed, 13 Apr 2022 23:48:06 GMT, Stuart Marks wrote: > but I suspect the cleanup may simply be removing them entirely. +1 for removing it. - PR: https://git.openjdk.java.net/jdk/pull/7928

Re: RFR: 8186958: Need method to create pre-sized HashMap [v16]

2022-04-13 Thread Stuart Marks
On Wed, 13 Apr 2022 20:06:34 GMT, Naoto Sato wrote: >> XenoAmess has updated the pull request incrementally with one additional >> commit since the last revision: >> >> revert changes in: >> src/java.desktop >> src/java.management >> src/jdk.internal.vm.ci >> src/jdk.jfr >> src/jdk.

Re: RFR: 8186958: Need method to create pre-sized HashMap [v18]

2022-04-13 Thread Stuart Marks
On Wed, 13 Apr 2022 22:20:14 GMT, XenoAmess wrote: >> 8186958: Need method to create pre-sized HashMap > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > update LastModified src/java.base/unix/classes/java/lang/ProcessEnvironmen

Re: RFR: 8186958: Need method to create pre-sized HashMap [v18]

2022-04-13 Thread Stuart Marks
On Wed, 13 Apr 2022 22:20:14 GMT, XenoAmess wrote: >> 8186958: Need method to create pre-sized HashMap > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > update LastModified src/java.xml/share/classes/com/sun/org/apache/xerces/i

Re: RFR: 8186958: Need method to create pre-sized HashMap [v18]

2022-04-13 Thread Stuart Marks
On Wed, 13 Apr 2022 22:20:14 GMT, XenoAmess wrote: >> 8186958: Need method to create pre-sized HashMap > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > update LastModified src/java.xml/share/classes/com/sun/org/apache/xalan/in

Re: RFR: 8186958: Need method to create pre-sized HashMap [v18]

2022-04-13 Thread Naoto Sato
On Wed, 13 Apr 2022 22:40:38 GMT, Stuart Marks wrote: >> XenoAmess has updated the pull request incrementally with one additional >> commit since the last revision: >> >> update LastModified > > src/java.base/share/classes/java/lang/Character.java line 8574: > >> 8572: private static

Re: RFR: 8186958: Need method to create pre-sized HashMap [v18]

2022-04-13 Thread Stuart Marks
On Wed, 13 Apr 2022 22:20:14 GMT, XenoAmess wrote: >> 8186958: Need method to create pre-sized HashMap > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > update LastModified src/java.base/share/classes/java/lang/Character.java l

Re: RFR: 8186958: Need method to create pre-sized HashMap [v16]

2022-04-13 Thread XenoAmess
On Wed, 13 Apr 2022 20:06:34 GMT, Naoto Sato wrote: >> XenoAmess has updated the pull request incrementally with one additional >> commit since the last revision: >> >> revert changes in: >> src/java.desktop >> src/java.management >> src/jdk.internal.vm.ci >> src/jdk.jfr >> src/jdk.

Re: RFR: 8186958: Need method to create pre-sized HashMap [v18]

2022-04-13 Thread XenoAmess
> 8186958: Need method to create pre-sized HashMap XenoAmess has updated the pull request incrementally with one additional commit since the last revision: update LastModified - Changes: - all: https://git.openjdk.java.net/jdk/pull/7928/files - new: https://git.openjdk.java.n

Re: RFR: 8186958: Need method to create pre-sized HashMap [v17]

2022-04-13 Thread XenoAmess
> 8186958: Need method to create pre-sized HashMap XenoAmess has updated the pull request incrementally with one additional commit since the last revision: Copyright latest year to 2022 - Changes: - all: https://git.openjdk.java.net/jdk/pull/7928/files - new: https://git.open

Re: RFR: 8186958: Need method to create pre-sized HashMap [v16]

2022-04-13 Thread Lance Andersen
On Wed, 13 Apr 2022 16:29:11 GMT, XenoAmess wrote: >> 8186958: Need method to create pre-sized HashMap > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > revert changes in: > src/java.desktop > src/java.management > src/jdk

Re: RFR: 8186958: Need method to create pre-sized HashMap [v16]

2022-04-13 Thread Joe Wang
On Wed, 13 Apr 2022 16:29:11 GMT, XenoAmess wrote: >> 8186958: Need method to create pre-sized HashMap > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > revert changes in: > src/java.desktop > src/java.management > src/jdk

Re: RFR: 8186958: Need method to create pre-sized HashMap [v16]

2022-04-13 Thread Naoto Sato
On Wed, 13 Apr 2022 16:29:11 GMT, XenoAmess wrote: >> 8186958: Need method to create pre-sized HashMap > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > revert changes in: > src/java.desktop > src/java.management > src/jdk

Re: RFR: 8186958: Need method to create pre-sized HashMap [v16]

2022-04-13 Thread Stuart Marks
On Wed, 13 Apr 2022 16:29:11 GMT, XenoAmess wrote: >> 8186958: Need method to create pre-sized HashMap > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > revert changes in: > src/java.desktop > src/java.management > src/jdk

Re: RFR: 8186958: Need method to create pre-sized HashMap [v14]

2022-04-13 Thread XenoAmess
On Wed, 13 Apr 2022 04:24:41 GMT, Stuart Marks wrote: > I've done some work on add test cases for these new static factory methods, > and I've also added API notes to the capacity-based constructors to link to > the new factory methods. Note that even though these are javadoc changes, the > AP

Re: RFR: 8186958: Need method to create pre-sized HashMap [v16]

2022-04-13 Thread XenoAmess
> 8186958: Need method to create pre-sized HashMap XenoAmess has updated the pull request incrementally with one additional commit since the last revision: revert changes in: src/java.desktop src/java.management src/jdk.internal.vm.ci src/jdk.jfr src/jdk.management.jfr src/jdk.mana

Re: RFR: 8186958: Need method to create pre-sized HashMap [v15]

2022-04-13 Thread XenoAmess
> 8186958: Need method to create pre-sized HashMap XenoAmess has updated the pull request incrementally with three additional commits since the last revision: - Add apiNote to appropriate constructors of HM, LHM, and WHM. - Add test cases for static factory methods. - Minor adjustment to test

Re: RFR: 8186958: Need method to create pre-sized HashMap [v14]

2022-04-12 Thread Stuart Marks
On Sun, 10 Apr 2022 20:28:16 GMT, XenoAmess wrote: >> 8186958: Need method to create pre-sized HashMap > > XenoAmess has updated the pull request with a new target base due to a merge > or a rebase. The pull request now contains 17 commits: > > - Merge branch 'master' into fix_8186958 > - var

Re: RFR: 8186958: Need method to create pre-sized HashMap [v14]

2022-04-10 Thread XenoAmess
> 8186958: Need method to create pre-sized HashMap XenoAmess has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 17 commits: - Merge branch 'master' into fix_8186958 - variable nameToReferenceSize rename to moduleCount - use (double) D

Re: RFR: 8186958: Need method to create pre-sized HashMap [v12]

2022-04-10 Thread XenoAmess
On Sun, 10 Apr 2022 07:41:05 GMT, Alan Bateman wrote: >> XenoAmess has updated the pull request incrementally with one additional >> commit since the last revision: >> >> use (double) DEFAULT_LOAD_FACTOR instead of 0.75 > > src/java.base/share/classes/java/lang/module/Resolver.java line 501:

Re: RFR: 8186958: Need method to create pre-sized HashMap [v13]

2022-04-10 Thread XenoAmess
> 8186958: Need method to create pre-sized HashMap XenoAmess has updated the pull request incrementally with one additional commit since the last revision: variable nameToReferenceSize rename to moduleCount - Changes: - all: https://git.openjdk.java.net/jdk/pull/7928/files -

Re: RFR: 8186958: Need method to create pre-sized HashMap [v12]

2022-04-10 Thread Alan Bateman
On Wed, 6 Apr 2022 16:02:31 GMT, XenoAmess wrote: >> 8186958: Need method to create pre-sized HashMap > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > use (double) DEFAULT_LOAD_FACTOR instead of 0.75 src/java.base/share/classe

Re: RFR: 8186958: Need method to create pre-sized HashMap [v12]

2022-04-09 Thread XenoAmess
On Sat, 9 Apr 2022 16:02:17 GMT, liach wrote: > > > Quick question: If the maps are intended to be fixed-size, can't the > > > users just call `new HashMap<>(size, 1)`, increasing the growth factor to > > > prevent growth? > > > > > > @liach this questions equals question : "why default load

Re: RFR: 8186958: Need method to create pre-sized HashMap [v12]

2022-04-09 Thread liach
On Sat, 9 Apr 2022 15:25:47 GMT, XenoAmess wrote: > > Quick question: If the maps are intended to be fixed-size, can't the users > > just call `new HashMap<>(size, 1)`, increasing the growth factor to prevent > > growth? > > @liach this questions equals question : "why default load factor be 0

Re: RFR: 8186958: Need method to create pre-sized HashMap [v12]

2022-04-09 Thread XenoAmess
On Sat, 9 Apr 2022 04:33:00 GMT, liach wrote: > Quick question: If the maps are intended to be fixed-size, can't the users > just call `new HashMap<>(size, 1)`, increasing the growth factor to prevent > growth? @liach this questions equals question : "why default load factor be 0.75 not 1" In

Re: RFR: 8186958: Need method to create pre-sized HashMap [v12]

2022-04-08 Thread liach
On Wed, 6 Apr 2022 16:02:31 GMT, XenoAmess wrote: >> 8186958: Need method to create pre-sized HashMap > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > use (double) DEFAULT_LOAD_FACTOR instead of 0.75 Quick question: If the map

Re: RFR: 8186958: Need method to create pre-sized HashMap [v12]

2022-04-08 Thread Stuart Marks
On Wed, 6 Apr 2022 16:02:31 GMT, XenoAmess wrote: >> 8186958: Need method to create pre-sized HashMap > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > use (double) DEFAULT_LOAD_FACTOR instead of 0.75 Regarding the scope of cal

Re: RFR: 8186958: Need method to create pre-sized HashMap [v12]

2022-04-06 Thread XenoAmess
On Wed, 6 Apr 2022 16:02:31 GMT, XenoAmess wrote: >> 8186958: Need method to create pre-sized HashMap > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > use (double) DEFAULT_LOAD_FACTOR instead of 0.75 There be another question:

Re: RFR: 8186958: Need method to create pre-sized HashMap [v10]

2022-04-06 Thread XenoAmess
On Wed, 6 Apr 2022 15:57:55 GMT, Alan Bateman wrote: > I suspect the core-libs label was added when you created it but you've > expanded it greatly since. Is there a way for making the bot re-calculate the labels? - PR: https://git.openjdk.java.net/jdk/pull/7928

Re: RFR: 8186958: Need method to create pre-sized HashMap [v11]

2022-04-06 Thread XenoAmess
On Wed, 6 Apr 2022 15:55:11 GMT, XenoAmess wrote: >> 8186958: Need method to create pre-sized HashMap > > XenoAmess has updated the pull request incrementally with two additional > commits since the last revision: > > - drop CalculateHashMapCapacityTestJMH > - refine javadoc for LinkedHashMap

Re: RFR: 8186958: Need method to create pre-sized HashMap [v10]

2022-04-06 Thread XenoAmess
On Wed, 6 Apr 2022 02:38:17 GMT, Stuart Marks wrote: >> XenoAmess has updated the pull request incrementally with one additional >> commit since the last revision: >> >> revert changes in jdk.compile > > src/java.base/share/classes/java/util/HashMap.java line 2556: > >> 2554: */ >> 2555

Re: RFR: 8186958: Need method to create pre-sized HashMap [v10]

2022-04-06 Thread Alan Bateman
On Wed, 6 Apr 2022 15:47:50 GMT, XenoAmess wrote: > I plan to include these changes to issue JDK-8186958, as I don't think it > better to flood about 50 P5 issues and do them seperately in every places. > > That would be a nightmare for reviewers. I didn't ask for 50 PRs, I just asked if you p

Re: RFR: 8186958: Need method to create pre-sized HashMap [v12]

2022-04-06 Thread XenoAmess
> 8186958: Need method to create pre-sized HashMap XenoAmess has updated the pull request incrementally with one additional commit since the last revision: use (double) DEFAULT_LOAD_FACTOR instead of 0.75 - Changes: - all: https://git.openjdk.java.net/jdk/pull/7928/files - ne

Re: RFR: 8186958: Need method to create pre-sized HashMap [v10]

2022-04-06 Thread XenoAmess
On Wed, 6 Apr 2022 00:54:41 GMT, Stuart Marks wrote: >> XenoAmess has updated the pull request incrementally with one additional >> commit since the last revision: >> >> revert changes in jdk.compile > > src/java.base/share/classes/java/util/LinkedHashMap.java line 792: > >> 790: >> 791:

Re: RFR: 8186958: Need method to create pre-sized HashMap [v10]

2022-04-06 Thread XenoAmess
On Wed, 6 Apr 2022 14:27:45 GMT, Alan Bateman wrote: > The current patch touches usages all over the JDK. Is that for illustration > purposes or are you planning to include them with the methods? @AlanBateman I plan to include these changes to issue JDK-8186958, as I don't think it better to

Re: RFR: 8186958: Need method to create pre-sized HashMap [v11]

2022-04-06 Thread XenoAmess
> 8186958: Need method to create pre-sized HashMap XenoAmess has updated the pull request incrementally with two additional commits since the last revision: - drop CalculateHashMapCapacityTestJMH - refine javadoc for LinkedHashMap#newLinkedHashMap - Changes: - all: https://git.

Re: RFR: 8186958: Need method to create pre-sized HashMap [v10]

2022-04-06 Thread Alan Bateman
On Sat, 2 Apr 2022 22:46:19 GMT, XenoAmess wrote: >> 8186958: Need method to create pre-sized HashMap > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > revert changes in jdk.compile The current patch touches usages all over the

Re: RFR: 8186958: Need method to create pre-sized HashMap [v10]

2022-04-05 Thread Stuart Marks
On Sat, 2 Apr 2022 22:46:19 GMT, XenoAmess wrote: >> 8186958: Need method to create pre-sized HashMap > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > revert changes in jdk.compile src/java.base/share/classes/java/util/HashMap

Re: RFR: 8186958: Need method to create pre-sized HashMap [v10]

2022-04-05 Thread liach
On Wed, 6 Apr 2022 01:13:11 GMT, Stuart Marks wrote: >> src/java.base/share/classes/java/util/LinkedHashMap.java line 804: >> >>> 802: * @since 19 >>> 803: */ >>> 804: public static LinkedHashMap newLinkedHashMap(int >>> numMappings) { >> >> `LinkedHashMap` may be often extended

Re: RFR: 8186958: Need method to create pre-sized HashMap [v10]

2022-04-05 Thread Stuart Marks
On Tue, 5 Apr 2022 23:16:57 GMT, liach wrote: >> XenoAmess has updated the pull request incrementally with one additional >> commit since the last revision: >> >> revert changes in jdk.compile > > src/java.base/share/classes/java/util/LinkedHashMap.java line 804: > >> 802: * @since 19 >

Re: RFR: 8186958: Need method to create pre-sized HashMap [v10]

2022-04-05 Thread Stuart Marks
On Sat, 2 Apr 2022 22:46:19 GMT, XenoAmess wrote: >> 8186958: Need method to create pre-sized HashMap > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > revert changes in jdk.compile I've drafted a CSR for this. Please review:

Re: RFR: 8186958: Need method to create pre-sized HashMap [v10]

2022-04-05 Thread Stuart Marks
On Sat, 2 Apr 2022 22:46:19 GMT, XenoAmess wrote: >> 8186958: Need method to create pre-sized HashMap > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > revert changes in jdk.compile src/java.base/share/classes/java/util/LinkedH

Re: RFR: 8186958: Need method to create pre-sized HashMap [v10]

2022-04-05 Thread liach
On Sat, 2 Apr 2022 22:46:19 GMT, XenoAmess wrote: >> 8186958: Need method to create pre-sized HashMap > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > revert changes in jdk.compile src/java.base/share/classes/java/util/LinkedH

Re: RFR: 8186958: Need method to create pre-sized HashMap [v7]

2022-03-30 Thread XenoAmess
On Wed, 30 Mar 2022 00:12:59 GMT, Stuart Marks wrote: >> XenoAmess has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - update jmh >> - refine javadoc; refine implement when expectedSize < 0 > > OK, finally got some time to look at this. H

Re: RFR: 8186958: Need method to create pre-sized HashMap [v8]

2022-03-30 Thread XenoAmess
> 8186958: Need method to create pre-sized HashMap XenoAmess has updated the pull request incrementally with one additional commit since the last revision: update codes - Changes: - all: https://git.openjdk.java.net/jdk/pull/7928/files - new: https://git.openjdk.java.net/jdk/

Re: RFR: 8186958: Need method to create pre-sized HashMap [v7]

2022-03-29 Thread Stuart Marks
On Thu, 24 Mar 2022 17:43:31 GMT, XenoAmess wrote: >> 8186958: Need method to create pre-sized HashMap > > XenoAmess has updated the pull request incrementally with two additional > commits since the last revision: > > - update jmh > - refine javadoc; refine implement when expectedSize < 0 O

Re: RFR: 8186958: Need method to create pre-sized HashMap [v7]

2022-03-27 Thread XenoAmess
On Thu, 24 Mar 2022 17:43:31 GMT, XenoAmess wrote: >> 8186958: Need method to create pre-sized HashMap > > XenoAmess has updated the pull request incrementally with two additional > commits since the last revision: > > - update jmh > - refine javadoc; refine implement when expectedSize < 0 S

Re: RFR: 8186958: Need method to create pre-sized HashMap [v7]

2022-03-26 Thread Stuart Marks
On Thu, 24 Mar 2022 17:43:31 GMT, XenoAmess wrote: >> 8186958: Need method to create pre-sized HashMap > > XenoAmess has updated the pull request incrementally with two additional > commits since the last revision: > > - update jmh > - refine javadoc; refine implement when expectedSize < 0 I

Re: RFR: 8186958: Need method to create pre-sized HashMap [v7]

2022-03-26 Thread XenoAmess
On Thu, 24 Mar 2022 17:43:31 GMT, XenoAmess wrote: >> 8186958: Need method to create pre-sized HashMap > > XenoAmess has updated the pull request incrementally with two additional > commits since the last revision: > > - update jmh > - refine javadoc; refine implement when expectedSize < 0 >

Re: RFR: 8186958: Need method to create pre-sized HashMap [v7]

2022-03-26 Thread Chris Hegarty
On Sat, 26 Mar 2022 12:51:04 GMT, liach wrote: >>> You probably wanna allow for a non-NEW instance for the corner case where >>> the given size is 0 - no elements. >> >> @ChrisHegarty I guess we shouldn't. >> >> I want to make it 100% equals to `new HashMap()` constructor, thus migrate >> all

Re: RFR: 8186958: Need method to create pre-sized HashMap [v7]

2022-03-26 Thread liach
On Sat, 26 Mar 2022 12:14:25 GMT, XenoAmess wrote: >> src/java.base/share/classes/java/util/HashMap.java line 2584: >> >>> 2582: >>> 2583: /** >>> 2584: * Creates a new, empty HashMap with an initial table size >> >> You probably wanna allow for a non-NEW instance for the corner case

Re: RFR: 8186958: Need method to create pre-sized HashMap [v7]

2022-03-26 Thread XenoAmess
On Sat, 26 Mar 2022 10:53:05 GMT, Chris Hegarty wrote: > You probably wanna allow for a non-NEW instance for the corner case where the > given size is 0 - no elements. @ChrisHegarty I guess we shouldn't. I want to make it 100% equals to `new HashMap()` constructor, thus migrate all usecases.

Re: RFR: 8186958: Need method to create pre-sized HashMap [v7]

2022-03-26 Thread Chris Hegarty
On Thu, 24 Mar 2022 17:43:31 GMT, XenoAmess wrote: >> 8186958: Need method to create pre-sized HashMap > > XenoAmess has updated the pull request incrementally with two additional > commits since the last revision: > > - update jmh > - refine javadoc; refine implement when expectedSize < 0 T

Re: RFR: 8186958: Need method to create pre-sized HashMap [v7]

2022-03-24 Thread XenoAmess
> 8186958: Need method to create pre-sized HashMap XenoAmess has updated the pull request incrementally with two additional commits since the last revision: - update jmh - refine javadoc; refine implement when expectedSize < 0 - Changes: - all: https://git.openjdk.java.net/jdk/

Re: RFR: 8186958: Need method to create pre-sized HashMap [v5]

2022-03-24 Thread XenoAmess
On Thu, 24 Mar 2022 17:09:21 GMT, Roger Riggs wrote: > I'm not too picky about how it is documented, as long as it is clear how the > number 1610612733 is computed and why its the correct number. And I think > that's working backward from Integer.MAX_VALUE. As for its precision, its > almost i

Re: RFR: 8186958: Need method to create pre-sized HashMap [v5]

2022-03-24 Thread Roger Riggs
On Thu, 24 Mar 2022 16:46:11 GMT, XenoAmess wrote: >>> It would be clearer with a comment on the constant or use the expression >>> (the compiler will evaluate it). `Integer.MAX_VALUE / 4 * 3`. >> >> @RogerRiggs >> >> No, as `Integer.MAX_VALUE / 4 * 3` is actually 1610612733, >> >> and `(int

Re: RFR: 8186958: Need method to create pre-sized HashMap [v5]

2022-03-24 Thread XenoAmess
On Thu, 24 Mar 2022 16:44:50 GMT, XenoAmess wrote: >> src/java.base/share/classes/java/util/HashMap.java line 2556: >> >>> 2554: */ >>> 2555: static int calculateHashMapCapacity(int expectedSize) { >>> 2556: if (expectedSize >= 1610612736) { >> >> It would be clearer with a com

Re: RFR: 8186958: Need method to create pre-sized HashMap [v5]

2022-03-24 Thread XenoAmess
On Thu, 24 Mar 2022 14:54:39 GMT, Roger Riggs wrote: > It would be clearer with a comment on the constant or use the expression (the > compiler will evaluate it). `Integer.MAX_VALUE / 4 * 3`. @RogerRiggs No, as `Integer.MAX_VALUE / 4 * 3` is actually 1610612733, and `(int)Math.ceil(161061273

Re: RFR: 8186958: Need method to create pre-sized HashMap [v5]

2022-03-24 Thread XenoAmess
On Thu, 24 Mar 2022 14:36:36 GMT, Roger Riggs wrote: > This method should say it is using a default load factor (0.75). @RogerRiggs done. > The default load factor should be mentioned. @RogerRiggs done. - PR: https://git.openjdk.java.net/jdk/pull/7928

Re: RFR: 8186958: Need method to create pre-sized HashMap [v6]

2022-03-24 Thread XenoAmess
> 8186958: Need method to create pre-sized HashMap XenoAmess has updated the pull request incrementally with one additional commit since the last revision: refine javadoc about default load factor - Changes: - all: https://git.openjdk.java.net/jdk/pull/7928/files - new: https

Re: RFR: 8186958: Need method to create pre-sized HashMap [v5]

2022-03-24 Thread Roger Riggs
On Thu, 24 Mar 2022 12:10:28 GMT, XenoAmess wrote: >> 8186958: Need method to create pre-sized HashMap > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > delete a space. src/java.base/share/classes/java/util/HashMap.java line 25

Re: RFR: 8186958: Need method to create pre-sized HashMap [v5]

2022-03-24 Thread XenoAmess
> 8186958: Need method to create pre-sized HashMap XenoAmess has updated the pull request incrementally with one additional commit since the last revision: delete a space. - Changes: - all: https://git.openjdk.java.net/jdk/pull/7928/files - new: https://git.openjdk.java.net/j

Re: RFR: 8186958: Need method to create pre-sized HashMap [v4]

2022-03-24 Thread XenoAmess
> 8186958: Need method to create pre-sized HashMap XenoAmess has updated the pull request incrementally with one additional commit since the last revision: use jmh Blackhole - Changes: - all: https://git.openjdk.java.net/jdk/pull/7928/files - new: https://git.openjdk.java.net

Re: RFR: 8186958: Need method to create pre-sized HashMap [v4]

2022-03-24 Thread XenoAmess
On Wed, 23 Mar 2022 21:04:52 GMT, liach wrote: >> XenoAmess has updated the pull request incrementally with one additional >> commit since the last revision: >> >> use jmh Blackhole > > test/jdk/java/util/Collections/CalculateHashMapCapacityTestJMH.java line 42: > >> 40: public class Calcula

Re: RFR: 8186958: Need method to create pre-sized HashMap [v3]

2022-03-24 Thread XenoAmess
> 8186958: Need method to create pre-sized HashMap XenoAmess has updated the pull request incrementally with one additional commit since the last revision: move the static functions to map classes themselves. - Changes: - all: https://git.openjdk.java.net/jdk/pull/7928/files

Re: RFR: 8186958: Need method to create pre-sized HashMap [v3]

2022-03-24 Thread XenoAmess
On Thu, 24 Mar 2022 00:44:02 GMT, liach wrote: > Note that the methods may have to go to somewhere else in `java.util` if > `Collections` cannot be loaded too early during startup, as HashMap is loaded > very early I'm afraid you are correct... moved the calculation function into HashMap seems

Re: RFR: 8186958: Need method to create pre-sized HashMap [v2]

2022-03-24 Thread XenoAmess
On Thu, 24 Mar 2022 11:15:12 GMT, David Holmes wrote: >> XenoAmess has updated the pull request incrementally with one additional >> commit since the last revision: >> >> fix javadoc's @return > > src/java.base/share/classes/java/util/Collections.java line 5836: > >> 5834: * @param

Re: RFR: 8186958: Need method to create pre-sized HashMap [v2]

2022-03-24 Thread XenoAmess
On Thu, 24 Mar 2022 11:14:54 GMT, David Holmes wrote: >>> That isn't what is returned. >> >> @dholmes-ora Yes it isn't actually. but I cannot find a better description >> string for it. >> >> "the pre-processed raw initial capacity for HashMap based classes." is more >> exact but sounds weird

Re: RFR: 8186958: Need method to create pre-sized HashMap [v2]

2022-03-24 Thread XenoAmess
> 8186958: Need method to create pre-sized HashMap XenoAmess has updated the pull request incrementally with one additional commit since the last revision: fix javadoc's @return - Changes: - all: https://git.openjdk.java.net/jdk/pull/7928/files - new: https://git.openjdk.java

Re: RFR: 8186958: Need method to create pre-sized HashMap

2022-03-24 Thread XenoAmess
On Thu, 24 Mar 2022 11:14:54 GMT, David Holmes wrote: >>> That isn't what is returned. >> >> @dholmes-ora Yes it isn't actually. but I cannot find a better description >> string for it. >> >> "the pre-processed raw initial capacity for HashMap based classes." is more >> exact but sounds weird

Re: RFR: 8186958: Need method to create pre-sized HashMap

2022-03-24 Thread David Holmes
On Wed, 23 Mar 2022 18:41:59 GMT, XenoAmess wrote: > 8186958: Need method to create pre-sized HashMap src/java.base/share/classes/java/util/Collections.java line 5836: > 5834: * @param the type of keys maintained by this map > 5835: * @param the type of mapped valu

  1   2   >