Тёмный

C# LINQ Performance Tips #3 - Where & Heap Allocations 

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

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

 

11 сен 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 7   
@sanjayi6245
@sanjayi6245 4 года назад
Very Informative. Keep going. I really like it.
@benjaminsampica7066
@benjaminsampica7066 4 года назад
Great videos
@MarinAtanasov
@MarinAtanasov 3 года назад
Hi LevelUp. I recently found your channel and I enjoy your videos. You cheated a bit with the performance by setting the list's capacity during ToList_Custom. This way you avoid expanding the internal array, but you are actually allocating a larger array than you need since the filtered items are fewer than the total count. Although that is sometimes fine to do if you want to sacrifice memory for cpu, it isn't consistent with the other implementations, including the for loop.
@kondziossj3
@kondziossj3 4 года назад
I am curious in what projects you worked and where it was useful to you because in my opinion it looks like constructing a combine for a 1m x 1m field The most what you told I already know, but probably I will share your video because it's easier to understand than my "potato talk" xD
@LevelUppp
@LevelUppp 4 года назад
I'm working in Big Data + NLP. The former needs absolute performance and the latter needs acceptable performance and flexibility, and this is an excellent candidate to have fast LINQ 🙂
@kondziossj3
@kondziossj3 4 года назад
that is strange that you didn't include `yield return`
@LevelUppp
@LevelUppp 4 года назад
Where? In the example set or adding yield to one of the existing examples? We can add a yield version too :) For existing examples, I didn't want to pay the cost of creating a state machine that could capture variables by accident. For simple state management, yield return is fine, but I avoid this pattern when I can since I've seen a lot of performance problems using yield and not understanding what it tries to accomplish with respect to user code.
Далее
C# LINQ Performance Tips #4 - Branch Elimination
15:03
Просмотров 2,7 тыс.
C# What JIT Generates? - Bounds Check
14:36
How Strong is Tin Foil? 💪
00:26
Просмотров 32 млн
iPhone 16 - презентация Apple 2024
01:00
Просмотров 129 тыс.
C# What JIT Generates? - Loop Cloning
14:25
Просмотров 1,2 тыс.
Cursor Is Beating VS Code (...by forking it)
18:00
Просмотров 74 тыс.
5 (Extreme) Performance Tips in C#
12:26
Просмотров 74 тыс.
Turns out REST APIs weren't the answer (and that's OK!)
10:38
C# What JIT Generates? - Struct Devirtualization
19:23
Просмотров 1,5 тыс.