Тёмный
LevelUp
LevelUp
LevelUp
Подписаться
A channel about cool (programming) experiments and research.
C# JIT Tier Performance
13:24
3 года назад
C# JIT Decompilation Tips using WinDBG
13:55
3 года назад
5 (Extreme) Performance Tips in C#
12:26
3 года назад
C# If Else Internals
22:42
3 года назад
C# Switch Case Internals #1
14:45
3 года назад
Welcome to my Channel
0:47
3 года назад
C# What JIT Generates? - Bounds Check
14:36
3 года назад
C# What JIT Generates? - Folds
10:36
3 года назад
C# What JIT Generates? - Loop Cloning
14:25
3 года назад
Performance bottlenecks in C# LINQ
19:55
4 года назад
Комментарии
@rmcgraw7943
@rmcgraw7943 25 дней назад
You should do it in parallel, where your total number of partitions is the same as the number of channels supported by your CPU (4 or 8 most common I believe), but not greater than the number of CPUs available.
@lemdanful
@lemdanful Месяц назад
It is not clear what capacity is? Because according to Wikipedia the probability of the error depends on count of inserted elements. So Wikipedia uses ‘n ‘ in computation of error’s rate where n is count of inserted elements.
@demesure9843
@demesure9843 Месяц назад
Very very interesting compilation of videos
2 месяца назад
I loved the video, thank you very much for the explanations. Just to clarify my understanding, the copy problem when using a List<>. The problem would be because Parse is returning a List<> of structs and in the code below in foreach it would be copying the object to the loop's local variable? foreach (var line in lines) { sum += line.Amount; }
@FromRootsToRadicals_INTP
@FromRootsToRadicals_INTP 2 месяца назад
nice
@budiardjo6610
@budiardjo6610 2 месяца назад
wow, it is really powerfull.
@gerakore8948
@gerakore8948 3 месяца назад
what if instead of multiplying you fill up the whole integer with the first bit from the & 1 result and & that with p[x]
@user-vi7xn1tj9f
@user-vi7xn1tj9f 3 месяца назад
Great video. I would only recommend to work on a proper naming convention, as you named all of the tested methods with quite generic (nothing saying) names.
@feitoza.system
@feitoza.system 3 месяца назад
I want a course from you, bro... I am loving you series about C# and high performance coding
@Speedyrides2021
@Speedyrides2021 5 месяцев назад
You can relate this to cryptocurrency
@user-wh1rc3bv4g
@user-wh1rc3bv4g 6 месяцев назад
Ставлю полтос что автор русскоговорящий)))
@mumk
@mumk 7 месяцев назад
Wow thank you so much, all solid performance tips, cheers
@taddeustentakel8598
@taddeustentakel8598 10 месяцев назад
Why is the array of bytes 20 bytes long when u have 4 ints in them? 4x4byte I thought it is?
@native-nature-video
@native-nature-video 10 месяцев назад
Why not just use C for performance? Code readability is more important than extra 30 milliseconds
@HikingUtah
@HikingUtah 11 месяцев назад
for (int i = 0; i < array.Length; i += 2) sum += array[i];
@stefanalecu9532
@stefanalecu9532 2 месяца назад
Which would be great if not for the fact you're only using half of the elements. Did you mean sum += array[i] + array[i+1]?
@HikingUtah
@HikingUtah 2 месяца назад
@@stefanalecu9532 He was talking about only adding the odd-numbered values. That's what my code does without branching.
@panic_seller
@panic_seller 11 месяцев назад
after spending time in the LeetCode Community, always force a HashMap at the problem🤣🤣
@FriedMonkey362
@FriedMonkey362 11 месяцев назад
You're ruining readability, but atleast its a second faster
@sirakghazaryan5272
@sirakghazaryan5272 Год назад
great work and explanation, but it would be better without the background music
@Zooiest
@Zooiest Год назад
There's a potentially faster version of your no-multiplication bit hacks: // For n-bit integers, use a shift of (n-1) counter += value & (value & 1) << 31 >> 31; To explain it, I'll use 8-bit integers for brevity: 1. (value & 1): is the value odd? 2. << 31: move the pseudo-boolean value to the sign bit 3. >> 31: perform a sign-extending(!) shift to the right, essentially creating a move mask 4. value &: use the move mask to either zero out or keep the value It'll look something like this: Value: 5 1. (0b00000101 & 1) = 1 2. 1 << 7 = 0b10000000 3. 0b10000000 >> 7 = 0b11111111 4. 0b00000101 & 0b11111111 = 5 Value: 6 1. (0b00000110 & 1) = 0 2. 0 << 7 = 0 3. 0 >> 7 = 0 4. 6 & 0 = 0 This method eliminates not only the multiplication, but also the subtraction. Would be interested to see if it's actually faster, though
@ar_xiv
@ar_xiv Год назад
I was frankly suspicious of C# properties/accessors when I first learned of them, but they were so built into every example I came across that I figured there was something magical they were doing that I didn't understand. I've since just gone back to public fields as I find them easier to reason about. So much example C# code has a private backing field and a public property that just returns the private field (before the simplified get; set;).
@dawidknaz5855
@dawidknaz5855 Год назад
I didn't know that Sam from LOTR knows C# XD :D
@nccnm
@nccnm Год назад
Can you share you program that visualize bit expressions? Thanks
@CompilerStuck
@CompilerStuck Год назад
The code highlighting is such a great idea! Well done :)
@Ruchir205
@Ruchir205 Год назад
Is using span similar to using the pointer?
@__hannibaal__
@__hannibaal__ Год назад
Bit or byte?
@tanishqvyas8387
@tanishqvyas8387 Год назад
What editor was used to edit the video?
@lukelyu3264
@lukelyu3264 Год назад
best animation, worst explanation in detail
@LevelUppp
@LevelUppp Год назад
Agreed, would do it better now.
@anonymoususer3561
@anonymoususer3561 Год назад
I have no idea what any of this means, clearly I'm still too green
@mohandeszalatan4576
@mohandeszalatan4576 Год назад
The bug that you've mentioned at method B2 (8:06) seems not to be there anymore at .NET 7. However, the value of variable 'l' will be copied to eax register and it will be used later for the bound checking even though it's marked as unused at the front end code. And again thanks for the great video.
@mohandeszalatan4576
@mohandeszalatan4576 Год назад
That was so insightful. Thanks for the great video.
@gerarldlee
@gerarldlee Год назад
The presentation is top notch. =)
@julkiewicz
@julkiewicz Год назад
Could you also make some videos about the differences in output on different operating systems? It seems like on Linux / Mac even the MS version of dotnet (the dotnet/runtime) essentially uses the merged in Mono under the hood. As a result a lot of code output and performance characteristics work completely differently to what happens in the WIndows world.
@NullReferenceExcepti0n
@NullReferenceExcepti0n Год назад
Kudos for the effort to create those videos Sir! It looks efortless but I know that this is a lot of work.
@rishitripathi5617
@rishitripathi5617 Год назад
Video style toh bole toh ekdumm zhakaassss....
@Junior.Nascimento
@Junior.Nascimento 2 года назад
Any use at this in a real word use case. Also if you really wants perfomance in this you can use: var sum = n/2 * ( 2*a + ( n - 1 )* d );
@NullReferenceExcepti0n
@NullReferenceExcepti0n 2 года назад
Super, jeszcze szczeke zbieram z klawiatury! Dobry pomysl!
@aniketbhura6131
@aniketbhura6131 2 года назад
how is this all done ? can you teach this or drop the sources for learning .
@abdelrhmanahmed1378
@abdelrhmanahmed1378 2 года назад
in groupByLookup you dont deal with collisions,and when i see the imp of groupBy provided by Microsoft it look very similar to yours , so why the performance gap is hug ?!
@franciscoserrano7227
@franciscoserrano7227 2 года назад
And the second part? (btw great video!)
@LevelUppp
@LevelUppp 2 года назад
Soon :)
@acecebov
@acecebov Год назад
still waiting for part 2
@PendelSteven
@PendelSteven 2 года назад
The fairly new SSD.M2 via PCI-Express 4 is about 7-8 GB/s actually.
@mfbx9da4
@mfbx9da4 2 года назад
Why do you use k hash functions instead of extracting the kth bit from the output of one hash function?
@LevelUppp
@LevelUppp 2 года назад
You need your value to have a sufficient overlap in the bit mask, thus to avoid any uniformity problems and distribution locality the easiest way is to use k different hash functions. There are a couple of tricks to get this down to just two hashes and generate the rest but it was out of the scope of this video.
@mfbx9da4
@mfbx9da4 2 года назад
@@LevelUppp what kind of uniformity / locality issues can arise? Isn’t the whole point of a hash function that it distributes uniquely?
@TUMENG-TSUNGF
@TUMENG-TSUNGF Год назад
@@mfbx9da4 ​What you describe is essentially still k hash functions. It’s just that every one of those k hash functions has the same first step and its second step is to take a different digit from the same number (the one generated from the first step, or the one hash function that you talked about)
@orterves
@orterves 2 года назад
How to achieve high performance in C# : Rewrite it in C++
@7th_CAV_Trooper
@7th_CAV_Trooper 2 года назад
Most developers will end up with worse performance in C++ because they can't even perform fundamental optimization in C#.
@NTT-ShortStories
@NTT-ShortStories 2 года назад
In fact, we rarely use Array in real world. Furthermore we can use multitasking for CPU-bound tasks or asynchronous for I/O-bound tasks to improve performance
@7th_CAV_Trooper
@7th_CAV_Trooper 2 года назад
you should use array as much as possible.
@antonio_carvalho
@antonio_carvalho Год назад
Who's this "we"? Of course programmers use a TON of arrays.
@jacobslusser4232
@jacobslusser4232 2 года назад
So awesome!
@MHjort9
@MHjort9 2 года назад
There's a point where readability is worth more than a tiny bit of performance
@7th_CAV_Trooper
@7th_CAV_Trooper 2 года назад
the point of writing high performance code is to flex in front of your teammates.
@IBITZEE
@IBITZEE 2 года назад
good info,,, RLE/RLL was used in the first hard drives interfaces... ;-)
@IBITZEE
@IBITZEE 2 года назад
very interesting... thanks!
@IBITZEE
@IBITZEE 2 года назад
wow... such a good info tool...
@sabitkondakc9147
@sabitkondakc9147 2 года назад
you're amazing Bartosz!