A channel about cool (programming) experiments and research.


LevelUp

Introduction to Compilers #1 - Folds
New blog post made out of infographics.

leveluppp.ghost.io/introduction-to-compilers-1/
#programming #csharp #cpp

4 years ago (edited) | [YT] | 2

LevelUp

Brand new video about JIT Tier Performance using C# programs.

I think I'm going to do more tests but instead of trying to fight with the JIT my current idea is to switch function pointers.

I'm planning to compile something in Tier0 then grab the function pointer in the MethodDescriptor when it changes my plan is to switch these pointers. It's sounds crazy but it just might work.

#csharp #dotnet #programming

4 years ago | [YT] | 1

LevelUp

The last infographic had a small mistake in the method signature.

So here's a fix:

A thread-wide memory barrier in C# is an "lock or" operation:

#csharp #dotnet #dotnetcore #programming #performance #cpu

4 years ago | [YT] | 7

LevelUp

A thread-wide memory barrier in C# is an "lock or" operation:

#csharp #dotnet #dotnetcore #programming #performance #cpu

4 years ago | [YT] | 7

LevelUp

What happens when you use atomic (Interlocked) methods in C#:

#csharp #dotnet #dotnetcore #programming #performance #cpu

4 years ago | [YT] | 13

LevelUp

dotnet JIT can eliminate branches provided that the flag in the condition is known as compile-time and it's not going to change over time.

It can be a field, property, of function which resolves to a const.

In this example, FlagA won't be eliminated since it generates a backing field. But there's a catch here since it will work when we convert it to a static expression property. The only problem is that it has to have its static initializer executed in Tier0 compilation and then it will get eliminated in Tier1 so it's a bit tricky to get right.

More JIT tricks and now well know facts here:

https://youtu.be/XLcPTf0efPk

https://youtu.be/soDX_IeZsqM

There's also an entire playlist on JIT alone:

www.youtube.com/playlist?list...

#csharp #dotnet #programming #performance

4 years ago | [YT] | 13

LevelUp

How the CPU stack works:

I'm going to do a video about the stack with a blog post as well. For now, please enjoy this. infographic :)

4 years ago | [YT] | 10