- 42
- 238 408
LevelUp
Poland
เข้าร่วมเมื่อ 6 ธ.ค. 2016
A channel about cool (programming) experiments and research.
วีดีโอ
.NET Decompilation Tools Show & Tell (PowerUp)
มุมมอง 2.4K3 ปีที่แล้ว
Link to the PowerUP: github.com/badamczewski/PowerUp Link to SharpLab: sharplab.io/ ♦ Twitter: badamczewski01 0:00 Intro 0:50 SharpLab 2:20 PowerUp 4:05 ASM Documentation 5:30 Drawing Jump Guides 6:00 Short Addresses 8:50 Shorthands 9:50 Running Code 10:45 Benchmarking Code 13:00 IL Code Decompilation 13:40 IL Code Compilation 14:55 Class & Struct Layout 17:10 GO Decompiler 19:40 Outro
Inlining heuristics in .NET / C# can be hilarious sometimes.
มุมมอง 2.1K3 ปีที่แล้ว
Inlining heuristics can be hilarious sometimes. The code is in C# / .NET, but similar things happen in other compilers. ♦ Twitter: badamczewski01
Short Animation about the Fibonacci Sequence and the Golden Ratio (And Generating The Golden Ratio)
มุมมอง 1.9K3 ปีที่แล้ว
This video is a short animation about an interesting fact about the golden ratio and the Fibonacci sequence. People are asking me how I'm Morphing the text like that, and it's a project in C# that I'm developing but it's kind of a mess that I'm slowly changing into a library so here's the morphing code as a gist: gist.github.com/badamczewski/06d9c86e6d78fc79905f943cb3545f51 If you have question...
Data Transfer Speeds of Disks and Memory (How fast is it?)
มุมมอง 2.4K3 ปีที่แล้ว
This video is a short animation that shows the performance of data access for various hardware components. In case you're wondering about what RAM means? The test was done using two PC-19200 DDR4 units from different computers. The CPU was i7-6700HQ People are asking me how I'm Morphing the text like that, and it's a project in C# that I'm developing but it's kind of a mess that I'm slowly chan...
What are Probabilistic Data Structures: Bloom Filters
มุมมอง 27K3 ปีที่แล้ว
This video will introduce you to Probabilistic Data Structures, and we shall cover a data structure called a Bloom Filter that's used to do efficient membership testing (if X is present in set S) Link to Bloom Filter Source Code: gist.github.com/badamczewski/42ec5d3aabd47c32684cdb87851f8a51 People are asking me how I'm Morphing the text like that, and it's a project in C# that I'm developing bu...
Data Structures: Introduction to Bit Sets
มุมมอง 12K4 ปีที่แล้ว
This video will introduce you to a Data Structure called a Bit Set. Small correction in (3:02) the 2nd-bit pattern for a number of 15 (001111) and not 23 (0010111) and the 4th 7-bit chunk has a number 40 (0101000) ♦ Instagram: level_uppp01 ♦ Twitter: badamczewski01 ♦ Blog: leveluppp.ghost.io The music in the video is licensed through Artlist.IO and I'm the license hold...
C# JIT Tier Performance
มุมมอง 2.4K4 ปีที่แล้ว
In this video, we're going to put JIT Tiered compilation to the test (using C# programs) and see what's the performance difference between Tier0 vs. Tier1 vs R2R. Links to Videos: JIT Tiers Explained: th-cam.com/video/BaFquQ9YZYU/w-d-xo.html Loop Cloning: th-cam.com/video/zxcHkEu6aTY/w-d-xo.html Switch-Case Internals: th-cam.com/video/soDX_IeZsqM/w-d-xo.html ♦ Instagram: level_upp...
C# JIT Decompilation Tips using WinDBG
มุมมอง 1.7K4 ปีที่แล้ว
In this video, we're going to learn about a few C# and JIT decompilation tips using WinDBG. Here's an infographic that shows how to get to MethodDescriptor and to JIT asm code: badamczewski01/status/1314858587471130625 Link to discussion why Loops are not Quick JITed: github.com/dotnet/docs/issues/15143 Note: I've been able to produce code that's "MinOptJitted" for code that contain...
5 (Extreme) Performance Tips in C#
มุมมอง 76K4 ปีที่แล้ว
In this video, I'm going to show you 5 performance tips (or tricks) that you can apply in order to make your C# code run faster. Everest Photo by Mário Simoes Attribution 2.0 Generic (CC BY 2.0): creativecommons.org/licenses/by/2.0/ flic.kr/p/HB3Ya6 ♦ Instagram: level_uppp01 ♦ Twitter: badamczewski01 ♦ Blog: leveluppp.ghost.io #csharp #dotnet #dotnetcore #performance #...
Spelunky 2 - No souls game has punished me this hard
มุมมอง 6254 ปีที่แล้ว
No souls game has punished me as hard as Spelunky 2 I hate it but I also love it. Send Help. #games #spelunky #game
C# If Else Internals
มุมมอง 3.7K4 ปีที่แล้ว
In this video, we're going to look at C# If Else Internals and what interesting things happen under the hood, and how they affect performance. Chapters: Into (0:00) If Inverted Jump (0:35) If Inverted Jump use case (7:48) If with a return (12:00) If with a throw (13:04) if with a throw helper (14:10) JIT branch elimination (17:26) JIT confused me :) (20:00) - Turns out that you don't need a fun...
C# Switch Case Internals #1
มุมมอง 2.7K4 ปีที่แล้ว
This is video is the start of a brand new series of videos about C# / CLR internals. We're going to look at C# Switch Case Internals and what interesting things happen under the hood and how well it performs as compared to if-else statements. ♦ Instagram: level_uppp01 ♦ Twitter: badamczewski01 ♦ Blog: leveluppp.ghost.io #csharp #dotnet #dotnetcore #performance #jit #in...
Welcome to my Channel
มุมมอง 1.7K4 ปีที่แล้ว
I really hope you enjoy your time here & consider subscribing :)
Can you use static types as generic arguments in C#? (Joke Video)
มุมมอง 1K4 ปีที่แล้ว
Can you use static types as generic arguments in C#? Let's find out :) ♦ Instagram: level_uppp01 ♦ Twitter: badamczewski01 ♦ Blog: leveluppp.ghost.io #csharp #dotnet #dotnetcore #performance #compiler
C# What JIT Generates? - Struct Devirtualization
มุมมอง 1.5K4 ปีที่แล้ว
C# What JIT Generates? - Struct Devirtualization
WinDBG - Get JIT Generated assembly code from a C# program
มุมมอง 7644 ปีที่แล้ว
WinDBG - Get JIT Generated assembly code from a C# program
C# What JIT Generates? - Integer Arithmetic
มุมมอง 2.2K4 ปีที่แล้ว
C# What JIT Generates? - Integer Arithmetic
C# LINQ Performance Tips #7 - Frameworks
มุมมอง 1.3K4 ปีที่แล้ว
C# LINQ Performance Tips #7 - Frameworks
C# LINQ Performance Tips #6 - Value Delegates
มุมมอง 2.5K4 ปีที่แล้ว
C# LINQ Performance Tips #6 - Value Delegates
C# LINQ Performance Tips #5 - Skip & .NET Runtimes
มุมมอง 2K4 ปีที่แล้ว
C# LINQ Performance Tips #5 - Skip & .NET Runtimes
C# LINQ Performance Tips #4 - Branch Elimination
มุมมอง 2.8K4 ปีที่แล้ว
C# LINQ Performance Tips #4 - Branch Elimination
C# LINQ Performance Tips #3 - Where & Heap Allocations
มุมมอง 2.1K4 ปีที่แล้ว
C# LINQ Performance Tips #3 - Where & Heap Allocations
C# LINQ Performance Tips #2 - Structs vs Classes
มุมมอง 4.9K4 ปีที่แล้ว
C# LINQ Performance Tips #2 - Structs vs Classes
C# LINQ Performance Fix #1 - Group By Correction
มุมมอง 2.9K4 ปีที่แล้ว
C# LINQ Performance Fix #1 - Group By Correction
C# LINQ Performance Tips #1 - Let keyword & Custom Lookup
มุมมอง 29K4 ปีที่แล้ว
C# LINQ Performance Tips #1 - Let keyword & Custom Lookup
How about conditional move, by ? : ternary operator?
What a lovely video, thank you. Shame it isnt more popular
I think this now got fixed
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.
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.
Very very interesting compilation of videos
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; }
nice
wow, it is really powerfull.
what if instead of multiplying you fill up the whole integer with the first bit from the & 1 result and & that with p[x]
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.
I want a course from you, bro... I am loving you series about C# and high performance coding
You can relate this to cryptocurrency
Ставлю полтос что автор русскоговорящий)))
Wow thank you so much, all solid performance tips, cheers
Why is the array of bytes 20 bytes long when u have 4 ints in them? 4x4byte I thought it is?
You need extra 4 bytes for the reference to the object itself.
Why not just use C for performance? Code readability is more important than extra 30 milliseconds
for (int i = 0; i < array.Length; i += 2) sum += array[i];
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]?
@@stefanalecu9532 He was talking about only adding the odd-numbered values. That's what my code does without branching.
after spending time in the LeetCode Community, always force a HashMap at the problem🤣🤣
You're ruining readability, but atleast its a second faster
great work and explanation, but it would be better without the background music
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
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;).
I didn't know that Sam from LOTR knows C# XD :D
Can you share you program that visualize bit expressions? Thanks
The code highlighting is such a great idea! Well done :)
Is using span similar to using the pointer?
Bit or byte?
What editor was used to edit the video?
I wrote my own piece of software to animate all of this
best animation, worst explanation in detail
Agreed, would do it better now.
I have no idea what any of this means, clearly I'm still too green
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.
That was so insightful. Thanks for the great video.
The presentation is top notch. =)
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.
I don't have a MAC, so only Linux would be possible.
Kudos for the effort to create those videos Sir! It looks efortless but I know that this is a lot of work.
Video style toh bole toh ekdumm zhakaassss....
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 );
Super, jeszcze szczeke zbieram z klawiatury! Dobry pomysl!
how is this all done ? can you teach this or drop the sources for learning .
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 ?!
And the second part? (btw great video!)
Soon :)
still waiting for part 2
The fairly new SSD.M2 via PCI-Express 4 is about 7-8 GB/s actually.
Why do you use k hash functions instead of extracting the kth bit from the output of one hash function?
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.
@@LevelUppp what kind of uniformity / locality issues can arise? Isn’t the whole point of a hash function that it distributes uniquely?
@@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)
How to achieve high performance in C# : Rewrite it in C++
Most developers will end up with worse performance in C++ because they can't even perform fundamental optimization in C#.
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
you should use array as much as possible.
We use arrays as much as possible, it's the fastest possible collection. Or ImmutableArray if we need the readonly part.
Who's this "we"? Of course programmers use a TON of arrays.
So awesome!
There's a point where readability is worth more than a tiny bit of performance
the point of writing high performance code is to flex in front of your teammates.
good info,,, RLE/RLL was used in the first hard drives interfaces... ;-)
very interesting... thanks!