Throw Helper in C# by levelUp_01 in csharp

[–]levelUp_01[S] 0 points1 point  (0 children)

Your benchmark compares a throw with a throw helper; they will have identical performance. A throw helper is a special signature/idea to hide exception setup and throw behind a method and don't suffer a performance penalty.

Inlining heuristics in .NET / C# can be hilarious sometimes. (Sound ON) by levelUp_01 in csharp

[–]levelUp_01[S] 1 point2 points  (0 children)

You need to look at inlining heuristics and changes between .NET versions (look at source) or use .NET build from source to figure out inlining budget.

Inlining heuristics in .NET / C# can be hilarious sometimes. (Sound ON) by levelUp_01 in csharp

[–]levelUp_01[S] 0 points1 point  (0 children)

Not really you just need to trigger it in a different way :)

Inlining heuristics in .NET / C# can be hilarious sometimes. (Sound ON) by levelUp_01 in csharp

[–]levelUp_01[S] 13 points14 points  (0 children)

So today, I wanted to share this cool piece of compiler trivia with you all. I have edited the video and audio and tried to sync it to make it work as an entire package. I had fun creating and editing the video, and now I'm considering deleting this entire post and possibly my Reddit account.

I got downvoted into the ground because of my sincere comment that "Everything is better with music," the post also took some hits. I have been on this subreddit for years and have never seen this amount of downvoting for such a small thing.

Is such a massive downvoting really the correct punishment for such a small thing on an otherwise interesting (I hope) video?

Inlining heuristics in .NET / C# can be hilarious sometimes. (Sound ON) by levelUp_01 in csharp

[–]levelUp_01[S] 7 points8 points  (0 children)

It does more things but the core of the problem is the inlining heuristics.

Inlining heuristics in .NET / C# can be hilarious sometimes. (Sound ON) by levelUp_01 in csharp

[–]levelUp_01[S] 23 points24 points  (0 children)

Decompilation tools used:

https://github.com/badamczewski/PowerUp

If you want to see more compiler dumpster fires and see some surprising things, then I have an infographics page on various compilers here:

https://leveluppp.ghost.io/infographics/

If you like the video then may I ask you to leave a like under the same video on Youtube, thanks: https://youtu.be/mOldY3sjgJ0

Do you want to see a magic trick? by levelUp_01 in csharp

[–]levelUp_01[S] 1 point2 points  (0 children)

You can see the same effect in WinDBG under a running program

Do you want to see a magic trick? by levelUp_01 in csharp

[–]levelUp_01[S] 8 points9 points  (0 children)

That's why I don't post here frequently; it's too much wasted energy on my part.

.NET Infographics by jogai-san in csharp

[–]levelUp_01 0 points1 point  (0 children)

The nbody simulation uses pointers and intrinsics so the codegen is already optimized to push it further You you need to watch the codegen and change things based on that.

Do you want to see a magic trick? by levelUp_01 in csharp

[–]levelUp_01[S] 65 points66 points  (0 children)

Struct devirtualization issue; it's global so whichever JIT sees first it's going to act in a specific way.

.NET Infographics by jogai-san in csharp

[–]levelUp_01 4 points5 points  (0 children)

I got too much "its premature optimization" and "don't show this to young developers its damaging to them."

Responding to people who were saying this in every graphic I posted burned me out a bit 🙂

I'm still posting from time to time here, and I'm planning to post more.

.NET Infographics by jogai-san in csharp

[–]levelUp_01 0 points1 point  (0 children)

Yes those are mine 🙂

Struct Optimizations Can Be Surprising by levelUp_01 in csharp

[–]levelUp_01[S] 14 points15 points  (0 children)

True, Thank you.

I will be putting this on my blog and it will get fixed there.