Тёмный

C# LINQ Performance Fix #1 - Group By Correction 

LevelUp
Подписаться 6 тыс.
Просмотров 2,9 тыс.
50% 1

This video is a correction of my previous video:
♦ • C# LINQ Performance Ti...
Where the last example tries to show a saving grace of LINQ and show a group by the operator that is very fast by default.
It turns out that I was not materializing the Query, so this video corrects the group by example and runs all the versions of the group by, and the results are not in the LINQs favor. Sorry folks, deal with it :)
Enjoy.
♦ Instagram: / level_uppp01
♦ Twitter: / badamczewski01
♦ Blog: leveluppp.ghos...
This is a project that aims to make LINQ implementation faster, and I think you should check it out:
♦ github.com/Net...
♦ github.com/Net...
#dotnet #dotnetcore #performance #linq

Опубликовано:

 

11 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 10   
@focl2003
@focl2003 4 года назад
Accepting you're wrong is good, correcting that fast is awesome. Thank you.
@LevelUppp
@LevelUppp 4 года назад
Thanks :)
@danflemming3553
@danflemming3553 4 года назад
Not trying to put your videos in a bad light, you're doing great to share your info, however performance is a very delicate subject because of so much complexity in the software (build-time compilation, run-time compilation, and hardware) Not saying you're not right, LINQ is slower definitely, with every abstraction there's a cost, however measuring how much that cost really is takes a lot of experience and mastery. I would not recommend against using LINQ unless there's really really a strong point. LINQ has great advantages in code readability
@LevelUppp
@LevelUppp 4 года назад
I agree with you here. However, some projects provide faster LINQ implementations, and that's something worth considering. There's also context-aware and type-aware LINQ that will do much better than the default implementation and will remain the same level of expressiveness. For example this is a very nice project that provides faster and more type aware LINQ: github.com/NetFabric/NetFabric.Hyperlinq Context-Specific LINQ is a bit harder to generalize but that's kind of the point. Where composition is being done all of the type information and business context gets baked in with the query and the executor will take all of this information and optimize the query. Lastly there's a concept of cost-free / zero-cost abstractions and that's something that has to be implemented inside the compiler but it's doable, just look at Rust as a reference/inspiration point.
4 года назад
@dan That's true but I once was assigned to a project that was taking 2 hours to run a bunch of LINQ queries on a large dataset. The data analysts could only perform one or two runs per day. Just by making some changes to the queries, I reduced it to 20 minutes. By removing LINQ, it could run in less than a minute. I like LINQ but it's important for people to be aware that LINQ can bite you hard.
@danflemming3553
@danflemming3553 4 года назад
​@ Yes, that's what I also said too.
@Adeith
@Adeith 4 года назад
Good on you for correcting your mistake.
@LevelUppp
@LevelUppp 4 года назад
Thanks, I need to pay more attention to the code and triple check it next time. Obviously mistakes can always happen but I'm trying to minimize them. New video about LINQ + Structs should be finished in a couple of days :)
@sanjayi6245
@sanjayi6245 4 года назад
Waiting for the next video
@LevelUppp
@LevelUppp 4 года назад
Here you go :) #2 ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-atUpAx_0lqg.html #3 ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-wUY-UdkI6GQ.html
Далее
C# LINQ Performance Tips #2 - Structs vs Classes
24:36
Просмотров 4,9 тыс.
5 (Extreme) Performance Tips in C#
12:26
Просмотров 74 тыс.
ФОКУС -СВЕТОФОР
00:32
Просмотров 211 тыс.
C# LINQ - group by
7:03
Просмотров 27 тыс.
C# What JIT Generates? - Bounds Check
14:36
C# What JIT Generates? - Loop Cloning
14:25
Просмотров 1,2 тыс.
The INSANE performance boost of LINQ in .NET 7
11:34
Просмотров 158 тыс.
07  LINQ Optimizing Performance
34:09
Просмотров 493
Brutally honest advice for new .NET Web Developers
7:19
C# If Else Internals
22:42
Просмотров 3,6 тыс.
ФОКУС -СВЕТОФОР
00:32
Просмотров 211 тыс.