Making LINQ Blazing fast with PLINQ (Parallel LINQ) | .NET & C# Essentials

  Рет қаралды 17,205

Amichai Mantinband

Amichai Mantinband

Күн бұрын

In today's video we're going to cover every single PLINQ (Parallel LINQ) extension method with examples.
PLINQ is a powerful and can make your LINQ queries extremely fast.
We're going to cover how PLINQ is implemented behind the scenes, what are all the various options, and almost everything you need to know about PLINQ before integrating it in your production applications.
Connect with me on 'em socials:
Twitter: / amantinband
LinkedIn: / amantinband
GitHub: github.com/amantinband
Check out all my courses on DomeTrain:
dometrain.com/author/amichai-...
Support the channel and get the source code:
/ amantinband
Thanks for watching, don't forget to like & comment & subscribe! ❤️ 💻
00:00. Overview
00:56. AsParallel
05:38. Mapping [thread id] to [sequence elements processed by that thread]
09:30. WithDegreeOfParallelism
09:50. How PLINQ works under the hood
15:05. AsOrdered
15:18. AsUnordered
15:40. ParallelEnumerable.Range
16:16. ParallelEnumerable.Repeat
16:29. ParallelEnumerable.Empty
16:48. AsSequential
18:45. WithCancellation
19:29. WithMergeOptions
26:26. Partitioning in PLINQ
29:35. WithExecutionMode
31:04. ForAll
33:22. Solving the PLINQ Riddle

Пікірлер: 27
@jerrydsta1056
@jerrydsta1056 2 ай бұрын
what is the .Dump() method references from? thanks!
@Silky987
@Silky987 2 ай бұрын
Great content, I've learned a little more today. Thank you!
@vitaliiodiichuk5317
@vitaliiodiichuk5317 2 ай бұрын
Really great description for plinq, thanks
@timur2887
@timur2887 2 ай бұрын
Great, thanks!
@user-jj5ov2lb2y
@user-jj5ov2lb2y 2 ай бұрын
Very good video. Thank you.
@Pezsmapatkany
@Pezsmapatkany 2 ай бұрын
Highly informative! Excellent job!
@TCFIFA
@TCFIFA 2 ай бұрын
עבודה מעולה!
@kesavanarayanaanaparthi6428
@kesavanarayanaanaparthi6428 2 ай бұрын
Nice tutorial😀 great effort keep up good work, could you please share the how to do the environment set up like you did for visual studio code
@Buutyful
@Buutyful 2 ай бұрын
thx :)
@Linkario86
@Linkario86 2 ай бұрын
This is great. I'm love using LINQ and this will certainly help make more performant LINQ queries. I assume Parallel foreach loops are still faster? Though the difference is probably smaller compared to sequential LINQ and foreach. What is the performance impact for ordering? Since .AsParallel() doesn't necessarily use Parallelism, do you recommend to add it to any LINQ-Query by default? Though if that were the case, Microsoft probably would've implemented it that way anyways.
@cccyberfamilydk
@cccyberfamilydk 2 ай бұрын
Nice. What if the HeavyComputation is Task based or ValueTask based? Is PLinq still the right way to go?
@Dustyy01
@Dustyy01 2 ай бұрын
Most of the time my "heavy computation" is async. Or I have many small operations which I need to use on the collection. How would I do that with PLINQ?
@amantinband
@amantinband 2 ай бұрын
PLINQ is best suited for long-running CPU-bound operations. If you’re dealing with many small operations or asynchronous computations (sending HTTP requests for example) then async await with Task.WhenAll is a better choice over PLINQ
@user-rd6zd5ym9m
@user-rd6zd5ym9m 2 ай бұрын
Thanks for this video Amichai, btw what's your tool to print on your screen boxes with arrows in colors with your mouse and keyboard ?
@amantinband
@amantinband 2 ай бұрын
Presentify
@omidkianifar5144
@omidkianifar5144 2 ай бұрын
Nice. It's time to create video for Task, await, cancellation token, asyn void, confiureawait false 😅😊🙏
@alfonsdeda8912
@alfonsdeda8912 2 ай бұрын
Great content, the difference between this and await Task.When all is that as Parallel is better to use with heavy and few computation, and task.whenall is better for "parallel" i/o operations?
@andreysemykin5879
@andreysemykin5879 2 ай бұрын
Async await is for IO. Parrallel, Task.Run is for cpu bound.
@mdnoverflow
@mdnoverflow 24 күн бұрын
how to scaffold test project to test all this ?
@minionmasterSXS
@minionmasterSXS 2 ай бұрын
this is probably a dumb question but... can you use P LINQ AND SIMD LINQ together?
@MrAymenmatador
@MrAymenmatador 2 ай бұрын
can we alternate between threads with PLINQ, like one method print "ping" the other print "pong" and get an output : "ping pong ping pong ping pong ..." ? thanks for the video :D
@amantinband
@amantinband 2 ай бұрын
If you need to maintain a specific order then you can use AsOrdered
@alexmel8448
@alexmel8448 2 ай бұрын
What do you mean by the sentence do you a favor and don't use pink in your applications because you need to be familiar with how things work under the hod ?
@amantinband
@amantinband 2 ай бұрын
Adding "AsParallel" without knowing how PLINQ works will likely introduce bugs or make your code even slower. It's important to understand how PLINQ actually works to know how to use it correctly.
@null-undefined
@null-undefined 2 ай бұрын
What is this dump() extension method?
@amantinband
@amantinband 2 ай бұрын
It’s a convenient way to print objects to the console. Check out the package Dumpify
Dependency Injection Deep Dive | .NET & C# Essentials
38:01
Amichai Mantinband
Рет қаралды 15 М.
Every Single LINQ Extension Method With Examples | .NET & C# Essentials
42:28
The Noodle Stamp Secret 😱 #shorts
00:30
Mr DegrEE
Рет қаралды 62 МЛН
Balloon Pop Racing Is INTENSE!!!
01:00
A4
Рет қаралды 16 МЛН
Why Developers Are OBSESSED With Obsidian
11:26
Amichai Mantinband
Рет қаралды 29 М.
Parallelization and PLINQ
20:43
Coding Tutorials
Рет қаралды 6 М.
Exceptions are evil. This is what I do instead.
24:41
Amichai Mantinband
Рет қаралды 16 М.
A Complete .NET Developer's Guide to Span with Stephen Toub
1:02:48
Stop Calling Your API a "REST API"
17:42
Amichai Mantinband
Рет қаралды 11 М.
Swagger is Going Away in .NET 9!
10:48
Nick Chapsas
Рет қаралды 65 М.
Back to Basics: Efficient Async and Await - Filip Ekberg - NDC Oslo 2023
1:01:25
"Stop Using Async Await in .NET to Save Threads" | Code Cop #018
14:05
На iPhone можно фоткать даже ночью😳
0:30
GStore Mobile
Рет қаралды 1,4 МЛН
The power button can never be pressed!!
0:57
Maker Y
Рет қаралды 46 МЛН
M4 iPad Pro Impressions: Well This is Awkward
12:51
Marques Brownlee
Рет қаралды 6 МЛН
Обзор игрового компьютера Макса 2в1
23:34
Обзор Pixel 8a
19:36
Rozetked
Рет қаралды 180 М.