Java 8 Parallel Streams | Parallel data processing and performance Example | JavaTechie

Поделиться
HTML-код
  • Опубликовано: 27 ноя 2024

Комментарии • 86

  • @aman3318
    @aman3318 2 года назад +4

    Thanks.. Instead of using employees. ParallelStream() we can also use employees.stream().parallel () , both of them are producing execution from parallel stream.

  • @nramca
    @nramca Год назад +3

    Great way to explain, concept was made clear that’s what matters

  • @devireddyfavreddy4785
    @devireddyfavreddy4785 Год назад +1

    Your way of explanation is really nice and clear

  • @jeebankishoremaharana3667
    @jeebankishoremaharana3667 3 года назад +2

    I really feel the response time today after using this..

  • @rajenderprasad1193
    @rajenderprasad1193 3 года назад +8

    Thank you very much for all the hard work you put for people like me

  • @gauravdewalkar4830
    @gauravdewalkar4830 3 года назад +2

    Thanks for all the efforts. ❤️ Keep making videos

  • @fanaha282
    @fanaha282 9 месяцев назад +1

    greatjob keep it up. You are going step by step respect for it

  • @nameshs9543
    @nameshs9543 3 года назад +1

    Wow man... Awesome tutorial.. All the best !!

  • @ultimatum97
    @ultimatum97 3 года назад +5

    At 1:27 you said that sequential stream uses multiple threads but single core, but at 8:27 you can see only 1 thread is used by sequential stream. Can you please explain about this more ?

  • @gauravdewalkar4830
    @gauravdewalkar4830 3 года назад +3

    Please make more videos on interview questions.
    Love your work.

  • @Iam_Raam
    @Iam_Raam 3 года назад +2

    Waaw...There are 4 brilliants who didn't like this video.....

  • @kishordige9721
    @kishordige9721 2 года назад +1

    This is exceptional!

  • @kriswright5112
    @kriswright5112 3 года назад +1

    love your channel. thanks for all your hard work.

  • @sheshanath
    @sheshanath 3 года назад +3

    Awesome video. I come to know a lot of thing from this video. But here is a question, what if you call parallel stream first and then normal stream in the same program. The execution time shows otherwise .

    • @Javatechie
      @Javatechie  3 года назад

      Purpose is different

    • @sheshanath
      @sheshanath 3 года назад

      @@Javatechie please specify how it work. if parallel processing is done first and after sequential stream then parallel is taking very much time than sequential.

    • @sheshanath
      @sheshanath 3 года назад

      I read some of article regarding, like benchmarking in java, but didn't understood much 😢😢😢😢😢

  • @koseavase
    @koseavase 3 года назад +1

    Genious on RUclips

  • @ravinasomvanshi6844
    @ravinasomvanshi6844 3 года назад +1

    Thank you so much. Very nicely explained.

  • @maruthigajula7613
    @maruthigajula7613 3 года назад +1

    It's nice tutorial bro .Keep rocking always

  • @kishordige9721
    @kishordige9721 2 года назад

    You make it so simple. #JavaTechieUniversity

  • @dipak002
    @dipak002 3 года назад +3

    Hey, Good video tutorials, but can you describe the pros and cons of using serial and parallel streams. It will be good if you can also say when to use these streams and why.

    • @Javatechie
      @Javatechie  3 года назад +1

      In begin I already mentioned
      Whenever you doesn't care for order of execution you should go for pareallstrem for example retrieve data from DB
      But it's always recommend to use write operation using parallstream if your data associated with other dependant entity or model

    • @dipak002
      @dipak002 3 года назад +1

      @@Javatechie I think you are suggesting to use serial stream to write operation if the data is dependent on other entities/models. Right?

    • @Javatechie
      @Javatechie  3 года назад +1

      Yes

    • @dipak002
      @dipak002 3 года назад +1

      @@Javatechie Thanks

  • @roshanpatro5777
    @roshanpatro5777 Год назад +2

    Thank you so much sir! A very useful video❤. I need one help. In my case the execution time for parallel stream is more than that of normal stream. Could you please help me here with the reasoning?

    • @Javatechie
      @Javatechie  Год назад +1

      Is it an IO intensive task or CPU intensive task?

    • @roshanpatro5777
      @roshanpatro5777 Год назад +1

      @@Javatechie Thanks for the response. I believe it is a CPU-intensive task because I tried with the same code you used in the video.

  • @robertstan6108
    @robertstan6108 3 года назад +1

    Super!!! Thanks for this video.

  • @Iam_Raam
    @Iam_Raam 3 года назад

    Thank you brother, clear explanation..

  • @ashwinmarathe9844
    @ashwinmarathe9844 Год назад +1

    Very well explained Sir.. thanks

  • @shikhagupta9063
    @shikhagupta9063 3 года назад +1

    Very well explained

  • @umeshnadargi219
    @umeshnadargi219 3 года назад +1

    Very simple explanation

  • @Saravanan-lj9so
    @Saravanan-lj9so 3 года назад +1

    Thanks. Please post lot of interview questions.

  • @sahilgandhi9156
    @sahilgandhi9156 Год назад +1

    Superb man, Thanks

  • @andresfernandoasfg
    @andresfernandoasfg 3 года назад +1

    Very well mate!

  • @amoldoifode2080
    @amoldoifode2080 3 года назад +1

    Great work buddy... Can you please made one video on Saga pattern in microservices

  • @ZiiiP2142
    @ZiiiP2142 10 месяцев назад

    Super informative.

  • @nurte4
    @nurte4 3 года назад +1

    very good bro!!! thanks!!

  • @sanketprajakta
    @sanketprajakta 3 месяца назад +1

    thanks for the nice explanation

  • @pratishrutipanda6461
    @pratishrutipanda6461 3 года назад +1

    Nice content

  • @josephnairpudupermanil8679
    @josephnairpudupermanil8679 2 года назад

    Awesome explanation..

  • @skill675
    @skill675 2 года назад +1

    Good explanation

  • @kamleshbca0290
    @kamleshbca0290 3 года назад

    I want to see the results by swapping code position..like firstly i will print parallel stream code block followed by normal stream and then see the difference

  • @samuelsodagudi
    @samuelsodagudi 3 года назад +1

    Thank you.

  • @sarojsahoo8763
    @sarojsahoo8763 3 года назад

    What happens when for certain code one's output will be input for next code to be executed . Even though multiple threads which is equivalent to multiple cores it has to be a serial execution.

  • @aaisnep
    @aaisnep Год назад +1

    tnkx, good video

  • @avdhootbhutkar8705
    @avdhootbhutkar8705 3 месяца назад

    bravo, thanks sir

  • @rohanpatale9797
    @rohanpatale9797 8 месяцев назад

    tq @Java Techie

  • @jdkim7036
    @jdkim7036 3 года назад +1

    Thanks, I am wondering how to control exceptions in stream?

    • @Javatechie
      @Javatechie  3 года назад +1

      I will cover that part don't worry

  • @bluerobox891
    @bluerobox891 2 года назад +1

    How can we try with arraylist as input and work on parallel

    • @Javatechie
      @Javatechie  2 года назад +1

      List.parallelStream() will help you

  • @Tsinepanos
    @Tsinepanos 2 года назад +1

    Is there any way to keep the ordering but running in parallel . In your example you loose the ordering in the parallel execution

    • @Javatechie
      @Javatechie  2 года назад

      In parallel we can't control order of execution

  • @MuraliM.A.
    @MuraliM.A. 5 месяцев назад

    Thanks for the video

  • @srikanthchowdary8595
    @srikanthchowdary8595 3 года назад +1

    Thank you very much for the videos, are you working in any it industry

    • @Javatechie
      @Javatechie  3 года назад

      Yes 😜

    • @srikanthchowdary8595
      @srikanthchowdary8595 3 года назад +1

      @@Javatechie is there any way to contact you for any queries related to java topics in future

    • @Javatechie
      @Javatechie  3 года назад

      javatechie4u@gmail.com

  • @sudhakarreddy1860
    @sudhakarreddy1860 3 года назад +1

    Please add all these in a playlist

    • @Javatechie
      @Javatechie  3 года назад

      Please checkout my java 8 playlist

  • @azharmobeen
    @azharmobeen 2 года назад +1

    Thanks man

  • @lpandp90
    @lpandp90 11 месяцев назад +1

    thank you!!

  • @vamsi0706
    @vamsi0706 2 года назад

    Hii...
    I have 3 queried need to run asyn....and need to wait for the results to store in list....
    Then after 3 tasks done...
    I need to proceed further running the remaining code....
    In this scenario...could anyone suggest which is better to use...
    I tried executor service...but it is going sync...not waiting for the threads to complete....
    Thanks in advance

  • @ritesisright
    @ritesisright 3 года назад +1

    Normal stream will be executed by same core???

  • @dp-sg8hc
    @dp-sg8hc 3 года назад

    Java8 playlist (www.youtube.com/watch?v=zp2tq...) shows spring boot tutorial

  • @anupamshahi3729
    @anupamshahi3729 2 года назад +2

    example does not seems to be correct, just flip the code and use parallel stream first and then use sequential stream you will see the sequential one takes less time than parallel one.

    • @Javatechie
      @Javatechie  2 года назад

      Thanks Anupam , will check and update

  • @itsnarahari
    @itsnarahari Год назад

    How can we handle if any thread is failing into it ?

  • @prashanttiwari3687
    @prashanttiwari3687 3 года назад +1

    sir ek vedio IntelliJ IDEA espe bana dejeye kaise install kare and kaise spring boot ke stah configure kare please

  • @narayanchoudhary4415
    @narayanchoudhary4415 2 года назад

    You have share spring boot playlist instead of java 8.

  • @RealSlimShady-um6gf
    @RealSlimShady-um6gf Год назад

    Using all CPU cores is not advisable and it's noticed CPU usage reaches more than threshold. For personal RND this is ok but not on Production environment. Example to calculate average using parallelstream is not making any sense.

  • @itsnarahari
    @itsnarahari 3 года назад +1

    How it will works internally ?

    • @Javatechie
      @Javatechie  3 года назад +1

      Please check second example where I log about worker thread

  • @radugribincea1423
    @radugribincea1423 2 года назад +1

    Could someone be so kind to explain me why at my computer, Plain stream took time : 3 but Parallel stream took time : 6. Parallel stream took more time than Plain stream.

    • @bhashkarsuman3227
      @bhashkarsuman3227 5 месяцев назад +1

      same problem with me

    • @Javatechie
      @Javatechie  5 месяцев назад

      Please try to run it couple of times and do the bench marking to figure it out

  • @mdrashidalam5282
    @mdrashidalam5282 3 года назад

    Please explain Linux tutorial and also design pattens

  • @yogesh970
    @yogesh970 2 года назад

    * Code is not formatted correctly, inconsistent spaces
    * One per line, every (.) and operation should come to the next line
    * Use `Instant` java.time class for start and end and use `Duration` to measure time between them
    (I know you are not aiming for these things in this example, this is for new developers)