The INSANE performance boost of LINQ in .NET 7

The INSANE performance boost of LINQ in .NET 7

Nick Chapsas

1 год назад

158,388 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@michaelm106
@michaelm106 - 22.09.2023 16:51

Every place I've work uses LINQ in "hot paths", performance wise I'd label not using LINQ as micro optimization... I would also decline any PR that had one off code already in System.Linq.

Ответить
@adrianotcc5663
@adrianotcc5663 - 20.03.2023 15:50

Code source, please. Thanks.

Ответить
@lutfisken
@lutfisken - 24.02.2023 16:56

Interesting but please talk a little bit slower in your videos to keep up with your english please....

Ответить
@marksmod
@marksmod - 12.02.2023 17:32

Was wondering why LINQ was so shit. C++ programmer going to C# is a bit underwhelming

Ответить
@giusepperana6354
@giusepperana6354 - 18.12.2022 11:52

Nice. I had the idea to vectorize summing once. Damnit, I could have been the first.

Ответить
@quannokiasamsung
@quannokiasamsung - 15.12.2022 16:56

It's unbelievable bro

Ответить
@virabhadra2
@virabhadra2 - 10.12.2022 00:59

Sorry, mate. But I tried this case for int and double for .net6 and .net7, and for non-zero array, but randomly generated numbers.
My benchmarking showed no difference between .net6 and .net7, and also between Linq max and onw max.
May be the improvement, what you are talking about is just about the jumping over the zero elements in .net7? That can make this difference in your case.

Ответить
@virabhadra2
@virabhadra2 - 08.12.2022 23:16

So, if you try not "int", but "float", you will see some difference. They are more or less equal for .net6, but for .net7 the difference is drastic: float is x10 slower than int.

Ответить
@messenja2547
@messenja2547 - 03.12.2022 09:56

who interferes to port net 7 code into your own library and use it in .net6 if u have alot of similar linq expressions)

Ответить
@F1nalspace
@F1nalspace - 02.12.2022 16:17

I knew it, after seeing the first benchmarks results that it uses SIMD under the hood now ;-)
SIMD is the best way to optimize any code that relies on mathmatical operations and its results - but only makes sense for medium/large amounts of data. Also you can even filter out values using Vector.ConditionalSelect() which makes it much more versatile.

Ответить
@dibaterman
@dibaterman - 02.12.2022 16:12

After I learned Lamda I've been a repeated LINQ abuser. I mean I'd be serving multiple life sentences with how hard I abuse it.

Ответить
@ivandrofly
@ivandrofly - 01.12.2022 12:47

I do the see the link to the post about vector

Ответить
@VamseeNunna
@VamseeNunna - 29.11.2022 10:14

It isn't 2 times fast or 5 times fast. It is actually insanely fast.

Ответить
@MaxIzrin
@MaxIzrin - 24.11.2022 15:32

Great news!

Ответить
@tonydrake462
@tonydrake462 - 24.11.2022 13:36

very nice - I have a startup that's 99.9% linq as I need to write so much in so little time (not premature the optimization) - and use Sum()/min()/max() a lot.. the move from to 6 was good and my customers always love the performance of my app - but this will just turbocharge my reports/queries - and take a load off the backend!! Whooo hoo.. a perfect upgrade for me.... thanks I will do it over the Christmas 'break'....

Ответить
@genepoole7848
@genepoole7848 - 19.11.2022 16:46

PR rejected for using LINQ, WTF... where does this happen lol.

Ответить
@MilYanXo
@MilYanXo - 17.11.2022 20:30

foreach runs over an enumerator, Own version should use for loop

Ответить
@brunodossantosrodrigues5049
@brunodossantosrodrigues5049 - 31.10.2022 17:02

Can we move everything to .NET 7? Apparently, they focused on performance and the results are amazing

Ответить
@co2boi
@co2boi - 31.10.2022 13:24

Another great video. I'd love to see your approach for a fully dynamic expression tree builder.

Ответить
@aleksanderpastuszak6788
@aleksanderpastuszak6788 - 26.10.2022 17:51

Thanks! I've been searching how to get it and this is brilliant :D

Ответить
@osarma
@osarma - 26.10.2022 14:23

Mind blowing 🤯 thank for sharing

Ответить
@omarbousbia6916
@omarbousbia6916 - 25.10.2022 18:10

so cool, thank you

Ответить
@vannersp
@vannersp - 24.10.2022 11:37

So the upshot is that they sped up a terribly slow process. Not the game changer it sounded like.

Ответить
@robertaldairneirazavala6491
@robertaldairneirazavala6491 - 22.10.2022 11:30

BROTHER, YOU ARE THE BEST!!! You oooh really helped me!! THANK YOU VERY MUCH!

Ответить
@cissemy
@cissemy - 21.10.2022 10:06

Great.
Is any download size improvement for Blazor wasm with .net 7?

Ответить
@sarathkurup1016
@sarathkurup1016 - 14.10.2022 16:43

Wow😵

Ответить
@parkercrofts6210
@parkercrofts6210 - 12.10.2022 23:25

Works good, tnx

Ответить
@nsa-iwillneverhityou
@nsa-iwillneverhityou - 08.10.2022 12:56

Thanks, Nick. Good job.

Ответить
@deepfriedtequila
@deepfriedtequila - 06.10.2022 13:08

It's just awesome

Ответить
@piccomediademo8587
@piccomediademo8587 - 04.10.2022 16:41

Thanks bro that was really helpful

Ответить
@brettshearerme
@brettshearerme - 01.10.2022 12:07

When someone makes something 45 times faster it is generally an indication they didn't care about performance when they first wrote it. The good thing is, this isn't that...

Ответить
@davidnguyen9065
@davidnguyen9065 - 30.09.2022 14:49

The moment you went to analyze the source code of C# itself was the moment I noped the fuck out

Ответить
@hienthu211
@hienthu211 - 29.09.2022 11:57

Bro, thx!

Ответить
@GazziFX
@GazziFX - 28.09.2022 06:04

Compare Max and Own_Max on simple array not IEnumerable

Ответить
@Midredel
@Midredel - 28.09.2022 00:19

You should use size is equal to 101 instead of 100. Bcs compiler have an optimizations on even sizes of collections. Creator of dotNet benchmark wrote about this.

Ответить
@netscapeinthewood3345
@netscapeinthewood3345 - 26.09.2022 13:30

This new dotnet 7 method also declares and uses new variables to calculate min/max, while benchmark tests report 0kb allocated. I am so confused

Ответить
@teacherspoll4408
@teacherspoll4408 - 24.09.2022 18:45

I thought it was a hoax, but everything works!

Ответить
@moofymoo
@moofymoo - 22.09.2022 09:01

Madness!

Ответить
@44Bigs
@44Bigs - 20.09.2022 09:41

Great, maybe our senior devs will finally let us use LINQ now 🙄

Ответить
@DamienSawyer
@DamienSawyer - 19.09.2022 14:20

Does this mean LINQ is competitive with Rust's zero cost abstractions?

Ответить
@slutmonke
@slutmonke - 18.09.2022 03:14

finally! took them long enough. I've been complaining about the speed since Linq was introduced.

Ответить
@erikaknop6089
@erikaknop6089 - 16.09.2022 02:09

Thank you. It really works 

Ответить
@viper110110
@viper110110 - 15.09.2022 20:57

I'd be interested in 1) Seeing how a foreach compares in performance to a for (int i = 0) situation and 2) seeing the performance of Linq Select and Where

Ответить
@gaanagamfoods4623
@gaanagamfoods4623 - 15.09.2022 20:06

Like

Ответить
@lucasmancini8675
@lucasmancini8675 - 15.09.2022 03:50

I just brought our legacy application to .net 6 leave me alone with .net 7 🤣😜

Ответить
@MehmetTEMEL123
@MehmetTEMEL123 - 15.09.2022 02:32

he read appres and pack books. after record video :D

Ответить
@pillington1338
@pillington1338 - 14.09.2022 23:27

I'd be curious to see these benchmark results on various platforms, especially iOS and Android, if the results are similar there then I can't wait for Unity to adopt .NET 7. Although Unity also converts mobile to C++ code, so I wonder if those gains would hold up after that translation.

Ответить
@binaryprofit3464
@binaryprofit3464 - 14.09.2022 03:39

Muchas gacias por compartir esta infor!

Ответить