tag:blogger.com,1999:blog-694855878384792308.post1486742236591136827..comments2024-03-21T06:26:49.387-07:00Comments on Java67: Java 8 - Map and Reduce Example Tutorialjavin paulhttp://www.blogger.com/profile/15028902221295732276noreply@blogger.comBlogger8125tag:blogger.com,1999:blog-694855878384792308.post-67920734331768683032021-02-14T06:35:36.573-08:002021-02-14T06:35:36.573-08:00The classical code ran faster for 3 million employ...The classical code ran faster for 3 million employees, but i started seeing the difference at around 10 million. Fron this point on, the parallel streams ran faster. So i guess the conclusion is that parallelism comes with an overhead which is only worthwhile once you cross a certain threshold of data volume.Mayankhttps://www.blogger.com/profile/00184292812295884976noreply@blogger.comtag:blogger.com,1999:blog-694855878384792308.post-42730773719678318892021-02-14T06:16:37.528-08:002021-02-14T06:16:37.528-08:00Hmm, interesting, did you checked your JVM is runn...Hmm, interesting, did you checked your JVM is running on server mode?javin paulhttps://www.blogger.com/profile/15028902221295732276noreply@blogger.comtag:blogger.com,1999:blog-694855878384792308.post-16500734984312221942021-02-05T12:45:04.439-08:002021-02-05T12:45:04.439-08:00Not sure why, but the lambda code takes at least t...Not sure why, but the lambda code takes at least twice as long as your 'classical' code. I'm running with parallel stream on a 16 core machine. To make a realistic test, I added 3 million employees to the collection.Mayankhttps://www.blogger.com/profile/00184292812295884976noreply@blogger.comtag:blogger.com,1999:blog-694855878384792308.post-40095219457249462482017-05-05T19:24:21.860-07:002017-05-05T19:24:21.860-07:00Hello Rohan, where exactly do you see the core get...Hello Rohan, where exactly do you see the core get utilized? Do you mean Task Manager - Performance tab - Open resource Monitor and then CPU tab?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-694855878384792308.post-9319309733097685202017-05-05T19:21:49.331-07:002017-05-05T19:21:49.331-07:00Yes, that's correct.Yes, that's correct.javin paulhttps://www.blogger.com/profile/15028902221295732276noreply@blogger.comtag:blogger.com,1999:blog-694855878384792308.post-74440539743017083862017-05-05T02:15:44.632-07:002017-05-05T02:15:44.632-07:00When you use parallel stream check you cpu in task...When you use parallel stream check you cpu in task manager. All core of cpu are used . So in future if we moved from quad core to octa core performance will increase. Atgendecaoaisishttps://www.blogger.com/profile/04508531081918344192noreply@blogger.comtag:blogger.com,1999:blog-694855878384792308.post-47631126660511676572016-10-01T22:49:18.795-07:002016-10-01T22:49:18.795-07:00Yes I think Javin is right. If you are using strea...Yes I think Javin is right. If you are using stream it will still be executed on a single core just like a normal sequential routine. For using parallelism we will have to use parallelSteam. Pulkithttps://www.blogger.com/profile/09018981497571056269noreply@blogger.comtag:blogger.com,1999:blog-694855878384792308.post-82564416947982994692016-10-01T18:32:34.099-07:002016-10-01T18:32:34.099-07:00If you are performing map-reduce in large scale, w...If you are performing map-reduce in large scale, which is always the case, you should use parallelStream() instead of stream() to get full advantage of multiple cores of your server. javin paulhttps://www.blogger.com/profile/15028902221295732276noreply@blogger.com