Timeline for Java Stream API - Best way to transform a list: map or forEach?
Current License: CC BY-SA 3.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 24, 2016 at 2:28 | comment | added | Tagir Valeev | @GiuseppeBertone, it's up to assylias, but to my opinion your edit contradicts the original author's intent. If you want to add your own answer, it's better to add it instead of editing the existing one so much. Also now the link to the microbenchmark is not relevant to the results. | |
S Jan 23, 2016 at 19:02 | history | suggested | Giuseppe Bertone | CC BY-SA 3.0 |
"Map" will have a big performance boost using parallel streams.
|
Jan 23, 2016 at 18:17 | review | Suggested edits | |||
S Jan 23, 2016 at 19:02 | |||||
Jan 23, 2016 at 18:00 | comment | added | Giuseppe Bertone | About performance, in your case "map" really wins over "forEach" if you use parallelStreams. My benchmaks in milliseconds: SO28319064.forEach: 187,310 ± 1,768 ms/op -- SO28319064.map: 189,180 ± 1,692 ms/op --SO28319064.mapParallelStream: 55,577 ± 0,782 ms/op | |
Feb 25, 2015 at 7:26 | audit | Low quality answers | |||
Feb 25, 2015 at 7:42 | |||||
Feb 4, 2015 at 15:03 | review | Low quality answers | |||
Feb 4, 2015 at 16:09 | |||||
Feb 4, 2015 at 12:09 | history | answered | assylias | CC BY-SA 3.0 |