Sign in

Sergiy Teplyakov

@steplyakov.bsky.social
319 followers 49 following 92 posts

Software Engineer at MSFT. Opinions are my own.

PostsRepliesMedia
Sergiy Teplyakov @steplyakov.bsky.social · 03/07/2026
I'm super happy to announce that, after 4 months working on it, my course Mastering C# is now live on Dometrain! The internals of records, structs, classes, union types, pattern matching, LINQ and much more: all covered in 3+ hours of advanced content. #dotnet #csharp
172
Sergiy Teplyakov @steplyakov.bsky.social · 02/02/2026
Do you know that just changing the C# langversion might affect performance? The code generation for method group conversion has changed in C# 11 to avoid allocations in certain cases.
020
Sergiy Teplyakov @steplyakov.bsky.social · 20/01/2026
New video on Dissecting the Code YouTube channel: ".NET 10 De-Abstraction in Action", that covers how .NET 10 almost completely eliminates the abstraction penalty when iterating over interfaces. #dotnet10, #performance
173
Sergiy Teplyakov @steplyakov.bsky.social · 08/01/2026
TIL that dotnet/runtime github repo has an awesome bot for running the benchmarks to compare the before and after! Here is an example:
140
Sergiy Teplyakov @steplyakov.bsky.social · 05/01/2026
Do you know that .NET 10 massively reduces the overhead of using any built-in collections via interfaces (yes, not only for arrays)? Iterating a list via IList<T>, or dictionary via 'IDictionary<K,V>', etc., now has almost zero abstraction penalty!
081
Sergiy Teplyakov @steplyakov.bsky.social · 06/10/2025
Hey #dotnet people. First milestone for Dissecting the Code YouTube channel - 1k subscribers! Thanks a lot everyone for your support and warm feedback that I'm getting!
130
Sergiy Teplyakov @steplyakov.bsky.social · 26/06/2025
Hey #dotnet people! Just published another episode on Dissecting the Code channel: How Google Broken the Internet and Why It Took 3 Hours to Recover? It's about null pointer bugs, retry logic and a bit of .NET Aspire used for visualizing the metrics. Please share and sub!
131
Sergiy Teplyakov @steplyakov.bsky.social · 19/06/2025
TIL about ValueTask.Preserve() helper method that returns a value task that may be used at any point in the future. ValueTasks are tricky and they can't be stored in a field, or awaited multiple times. Preserve "fixes" that by allocating Task<T> under the hood.
262
Sergiy Teplyakov @steplyakov.bsky.social · 06/06/2025
Hey #dotnet people:) Just published another episode on Dissecting the Code YouTube channel - "Can Tiered Compilation Cause Memory Leaks in .NET". This video is about a change in behavior between full framework on .net 9 in respect to GCInfo and how it affect memory usage.
163
Sergiy Teplyakov @steplyakov.bsky.social · 03/06/2025
Just added a rule to ErrorProne.NET to detect simple recursive calls. This may sound too simplistic, but I've seen such code being checked in by an accident. And I've faced StackOverflowException because of that in my tests before myself as well.
120
Sergiy Teplyakov @steplyakov.bsky.social · 30/05/2025
Hey #dotnet people:) Just published another episode on Dissecting the Code YouTube channel - "Dissecting Memory Leaks in .NET". How global events, hidden static collection and timers can cause memory leaks and the ways to avoid it. Link in the comment below.
173
Sergiy Teplyakov @steplyakov.bsky.social · 22/05/2025
Hey #dotnet people! I've launched my YouTube channel: "Dissecting the Code". It's going to be very similar to my blog with a lot of deep dives into #dotnet, #csharp etc. I've already published the first two videos: ➡️ Episode 0: What You'll Learn Here ➡️ Episode 1: Dissecting Variable Lifetime
2408
Sergiy Teplyakov @steplyakov.bsky.social · 02/05/2025
Do you know that CA2241 analyzer (for correct args to formatting methods) is very extensible? It supports: * built-in methods * StringSyntaxAttribute * Methods listed in .editorconfig Try to run it in your codebase, you might be surprised, how many violations do you have!
010
Sergiy Teplyakov @steplyakov.bsky.social · 24/04/2025
Ok, this is not magic. Its possible when the instance method can be inlined and it doesn't touch the instance state itself. Here is the code:
010
Sergiy Teplyakov @steplyakov.bsky.social · 24/04/2025
Ok, here is a thing. "We all know" that a managed instance can be collected during the method call. But do you know that an instance can be GCed **before** the instance method is called? This works in Release mode only due to the tracking the JIT does via GCInfo. #dotnet
120
Sergiy Teplyakov @steplyakov.bsky.social · 14/04/2025
Hot take: in some cases it is useful to profile an app in debug mode. Was helping in a performance analysis and it was not clear where the time is spent exactly. Re-ran profiler in debug build to see that it was a property getter that was used in a hot loop!
120
Sergiy Teplyakov @steplyakov.bsky.social · 18/03/2025
Just FYI. If you need to check if a char is within a string, using 'str.IndexOf(c) != -1' is way more efficient than using 'str.Contains(c)' which is a call to 'Enumerable.Contains(string, c)'. Actually the IndexOf version is way more efficient! (the results for full framework)
281
Sergiy Teplyakov @steplyakov.bsky.social · 26/02/2025
Blogged: Finalizers are tricker than you might think, Part 1. The post is very close to a 5 Why type of postmortem we use internally for the incidents where I cover an investigation of crashes caused by NullReferenceExceptions from the finalizers. #dotnet
141
Sergiy Teplyakov @steplyakov.bsky.social · 30/01/2025
A bunch of awesome stuff is coming to .net10! One notable thing: lack of enumerator boxing allocations when iterating over an array via `IEnumerable<T>`. This is awesome! The link to github: github.com/dotnet/runti...
071
Sergiy Teplyakov @steplyakov.bsky.social · 29/01/2025
Blogged: "The Dangers of Async Void". The gif from amazing @kirillosenkov.com is the best way to visualize the issues with async void. Kind of - ¯\_(ツ)_/¯. The link to the blog post: sergeyteplyakov.github.io/Blog/csharp/... #dotnet, #csharp
392
Sergiy Teplyakov @steplyakov.bsky.social · 26/01/2025
Please, measure the results of your optimizations! Just saw that a custom enum to string conversion was quite expensive. Added a new version and compared the optimization with just 'enum.ToString' The old "optimization" was 5x slower and was allocating way more memory!
110
Sergiy Teplyakov @steplyakov.bsky.social · 07/01/2025
The evolution of string.Split #dotnet #benchmarking
0123