Withdrawn: 8282178: Replace simple iterations of Map.entrySet with Map.forEach calls

2022-05-19 Thread duke
On Wed, 23 Feb 2022 22:33:42 GMT, liach wrote: > Replaces simple `for (Map.Entry entry : map.entrySet())` with > `map.forEach((k, v) ->)` calls. This change is better for thread-safety and > reduces allocation for some map implementations. > > A more in-depth descript

Re: RFR: 8282178: Replace simple iterations of Map.entrySet with Map.forEach calls

2022-03-24 Thread liach
On Wed, 23 Feb 2022 22:33:42 GMT, liach wrote: > Replaces simple `for (Map.Entry entry : map.entrySet())` with > `map.forEach((k, v) ->)` calls. This change is better for thread-safety and > reduces allocation for some map implementations. > > A more in-depth descript

Re: Replace simple iterations of Map.entrySet with Map.forEach calls

2022-03-05 Thread -
I've made a benchmark with visualized results on putting a map of a f

Re: Replace simple iterations of Map.entrySet with Map.forEach calls

2022-03-05 Thread Remi Forax
- Original Message - > From: "Stuart Marks" > To: "-" , "core-libs-dev" > > Sent: Saturday, March 5, 2022 1:58:30 AM > Subject: Re: Replace simple iterations of Map.entrySet with Map.forEach calls > Hi, I have to say I'm pretty skep

Re: Replace simple iterations of Map.entrySet with Map.forEach calls

2022-03-04 Thread -
Sounds reasonable. Then how about the claims on performance improvement, especially for maps that have to create entry objects on entry set iteration? In my few jmh benchmarks run, it seems adding from identity hash map at least is sped up, while most other maps have no significant difference. On

Re: Replace simple iterations of Map.entrySet with Map.forEach calls

2022-03-04 Thread Stuart Marks
Hi, I have to say I'm pretty skeptical of this change overall. It sounds like the main issue is iterating over the entrySet of a map that might be modified concurrently. The bug report says > for concurrent maps, regular iteration of entrySet may fail spontaneously This isn't true for Concurr

Re: RFR: 8282178: Replace simple iterations of Map.entrySet with Map.forEach calls

2022-02-23 Thread liach
On Wed, 23 Feb 2022 23:50:49 GMT, PROgrm_JARvis wrote: >> Replaces simple `for (Map.Entry entry : map.entrySet())` with >> `map.forEach((k, v) ->)` calls. This change is better for thread-safety and >> reduces allocation for some map implementations. >> >&g

Re: RFR: 8282178: Replace simple iterations of Map.entrySet with Map.forEach calls

2022-02-23 Thread PROgrm_JARvis
On Wed, 23 Feb 2022 22:33:42 GMT, liach wrote: > Replaces simple `for (Map.Entry entry : map.entrySet())` with > `map.forEach((k, v) ->)` calls. This change is better for thread-safety and > reduces allocation for some map implementations. > > A more in-depth descript

RFR: 8282178: Replace simple iterations of Map.entrySet with Map.forEach calls

2022-02-23 Thread liach
Replaces simple `for (Map.Entry entry : map.entrySet())` with `map.forEach((k, v) ->)` calls. This change is better for thread-safety and reduces allocation for some map implementations. A more in-depth description of benefits is available at https://mail.openjdk.java.net/pipermail/core-l

Replace simple iterations of Map.entrySet with Map.forEach calls

2022-02-22 Thread -
Hello, In the patch for 8281631 , xenoamess intentionally avoided repeatedly calling Map::size, for it may not be constant-timed due to being concurrent. This alerted me that the for l

Re: Map.forEach

2013-12-10 Thread Doug Lea
On 12/10/2013 01:15 PM, Martin Buchholz wrote: Perhaps Doug could provide history on the intent of ConcurrentMap. See the package-level docs in java.util.concurrent that compare Hashtable to ConcurrentMap, implying that it might not be a good idea to now retrospectively declare Hashtable as a C

Re: Map.forEach

2013-12-10 Thread Mike Duigou
On Dec 10 2013, at 01:06 , Paul Sandoz wrote: > On Dec 10, 2013, at 5:14 AM, Martin Buchholz wrote: >> >> Hmmm... it was time that I studied Map.forEach I see you convert to >> ISE to CME ... >> >> (Synchronized maps (like Hashtable) do not implement

Re: Map.forEach

2013-12-10 Thread Paul Sandoz
On Dec 10, 2013, at 5:14 AM, Martin Buchholz wrote: > > Hmmm... it was time that I studied Map.forEach I see you convert to > ISE to CME ... > > (Synchronized maps (like Hashtable) do not implement ConcurrentMap. Is > that a bug?) > > Imagine a third p

Re: Map.forEach

2013-12-09 Thread Mike Duigou
On Dec 9 2013, at 17:50 , Martin Buchholz wrote: > Current ConcurrentMap.forEach > http://gee.cs.oswego.edu/dl/concurrent/dist/docs/java/util/concurrent/ConcurrentMap.html#replaceAll-java.util.function.BiFunction- > has two different "specs" for the default method: > > Implementation Requiremen