Sergiy Teplyakov's Avatar

Sergiy Teplyakov

@steplyakov.bsky.social

Software Engineer at MSFT. Opinions are my own.

314 Followers  |  47 Following  |  87 Posts  |  Joined: 06.12.2024  |  1.769

Latest posts by steplyakov.bsky.social on Bluesky

And, as always, thanks for sharing.

/cc: @davidfowl.com, @scott.hanselman.com, @migueldeicaza.bsky.social

04.02.2026 16:46 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

I've seen cases when the application code was filled with it "to improve performance" or "to avoid deadlocks". And it was very hard to convince that this is not how ConfigureAwait should be used.

In this video I'm covering why we have ConfigureAwait in the first place and how to use it correctly.

04.02.2026 16:46 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Stop using ConfigureAwait(false) incorrectly!
YouTube video by Dissecting The Code Stop using ConfigureAwait(false) incorrectly!

Another video on Dissecting the Code YouTube channel: "ConfigureAwait best practices".

I feel we have a cargo cult on using ConfigureAwait without thinking too much.

youtu.be/bUHQeY-DlBc?...

04.02.2026 16:46 β€” πŸ‘ 2    πŸ” 2    πŸ’¬ 1    πŸ“Œ 0
Post image

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.

02.02.2026 16:45 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 1

And, as always, I would really appreciate the repost!

/cc: @kirillosenkov.com, @davidfowl.com, @jaredpar.bsky.social, @migueldeicaza.bsky.social, @scott.hanselman.com, @damianedwards.com

20.01.2026 16:16 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
.NET 10 De-Abstraction in Action
YouTube video by Dissecting The Code .NET 10 De-Abstraction in Action

Link to the video: youtu.be/Ysg85IR6rMc?...

20.01.2026 16:16 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Post image

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

20.01.2026 16:16 β€” πŸ‘ 7    πŸ” 3    πŸ’¬ 1    πŸ“Œ 0

And big thanks to Egor from the JIT team for showing his awesome bot!

08.01.2026 14:26 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
Add AggressiveInlining to EnsureInitializedCore method to allow delegates stack alloc by SergeyTeplyakov Β· Pull Request #122983 Β· dotnet/runtime Currently stack allocation (and overall de-abstraction) works only when JIT can has a full understanding of the code. And due to lack of cross-prodcedural analysis it means that for the optimizatio...

Here is a link to my PR: github.com/dotnet/runti...

And once this is merged we should have way fewer allocations when using LazyInitializer.EnusreInitialized by stack-allocating a delegate passed as Func<T>

08.01.2026 14:26 β€” πŸ‘ 3    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Post image

TIL that dotnet/runtime github repo has an awesome bot for running the benchmarks to compare the before and after!

Here is an example:

08.01.2026 14:26 β€” πŸ‘ 4    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Ah! I get the issue. The clients won’t be able to use the lib if it has extension members! Sigh!

08.01.2026 14:08 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

I’m curious what’s the issue with manually specifying lang version as 14 when targeting older frameworks? I constantly relying on this even using latest C# when targeting Full Framework (yes some features won’t work, but the vast majority will work).

08.01.2026 14:01 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Post image

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!

05.01.2026 15:33 β€” πŸ‘ 8    πŸ” 1    πŸ’¬ 0    πŸ“Œ 0
Preview
Fabulous Adventures in Data Structures and Algorithms - Eric Lippert Author Eric Lippert introduces fabulous solutions using uncommon algorithms and data structures. There’s a lot more to algorithms than the useful-but-boring recipes you recite for every interview. Th...

I'm writing another book, and the first few chapters are available through Manning Early Access now! For 50% off!

hubs.la/Q03Q9PGP0

More details, and the story of how I came to write it, are on my blog at

ericlippert.com/2025/10/30/i...

It feels great to be writing again after a long break. :)

30.10.2025 16:39 β€” πŸ‘ 47    πŸ” 17    πŸ’¬ 5    πŸ“Œ 0

Yep. But this is something that I've figured out just earlier today.
Was hoping for something in .editorconfig: `dotnet_diagnostics.category-Compiler.severity = error'. But I don't think that's available.
The point is that its a roundabout way to achieving this. And not easy to find.

23.10.2025 14:55 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

its a bit too much :). I would definitely prefer one liner.
My option is two liners which is ok, but requires directory.build.props. I'm surprised that it's seems impossible to do that in one line in .editorconfig.

23.10.2025 14:13 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Correction: I want to keep static analysis warnings as warnings.

23.10.2025 13:44 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

I want to fail the build on compiler warnings, but keep the diagnostics warnings as warnings.
One option that I've found is to set 'TreatWarningsAsErrors' to true, and set 'CodeAnalysisTreatWarningsAsErrors' to false.
Is there a better way?

/cc: @jaredpar.bsky.social, @terrajobst.net

23.10.2025 13:42 β€” πŸ‘ 3    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Preview
Finding a VS Code Memory Leak In 2021 I found a huge memory leak in VS code, totalling around 64 GB when I first saw it, but with no actual limit on how high it could go. I found this leak despite two obstacles that should have…

New blog post:
In 2021 I found an invisible memory leak in a tool (VS Code) that I have never used. Impossible? Easy:
randomascii.wordpress.com/2025/10/09/f...

09.10.2025 20:27 β€” πŸ‘ 53    πŸ” 15    πŸ’¬ 1    πŸ“Œ 0

As always, I'll appreciate the feedback and I would love if you share the video with your network! It means a lot to me!

/cc: @visualstudio.com, @migueldeicaza.bsky.social, @rephuffman.bsky.social, @scott.hanselman.com, @davidfowl.com

08.10.2025 21:07 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Parallel Stacks: The best Visual Studio feature for asynchronous and parallel code
YouTube video by Dissecting The Code Parallel Stacks: The best Visual Studio feature for asynchronous and parallel code

New video on Dissecting the Code YouTube Channel.

This time, it's about Parallel Stacks - my very favorite
@visualstudio.com
feature that you probably are not using enough!

I can't even count how many times it helped me production incidents investigations!
youtu.be/Z5mN0VCB-KA?...

08.10.2025 21:07 β€” πŸ‘ 2    πŸ” 2    πŸ’¬ 1    πŸ“Œ 0
Preview
Dissecting The Code Dissecting the Code is a channel for developers who want to master .NET from the inside out. If you're tired of surface-level tutorials and want to truly understand what’s happening under the hood, y...

And if by any chance you haven't subscribed yet, here is the link to the channel ;)

www.youtube.com/@DissectingT...

06.10.2025 14:51 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Post image

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!

06.10.2025 14:51 β€” πŸ‘ 3    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Oh! They use a custom taskscheduler for that. Interesting!

02.10.2025 21:14 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

/cc: @migueldeicaza.bsky.social, @terrajobst.net, @scott.hanselman.com, @visualstudio.com, @damianedwards.com and other. I would really appreciate if you'll share the link!

02.10.2025 18:40 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Dissecting ConfigureAwait in C#
YouTube video by Dissecting The Code Dissecting ConfigureAwait in C#

After a short break I'm back with the new video on Dissecting the Code YouTube channel.

This time its all about ConfigureAwait, why we ended up having it and how it works under the hood!

#dotnet folks, please share! I'll really appreciate it!

youtu.be/RZsLA_R8i9s?...

02.10.2025 18:40 β€” πŸ‘ 11    πŸ” 5    πŸ’¬ 2    πŸ“Œ 0
Preview
docs/docs/standard/unsafe-code/best-practices.md at main Β· dotnet/docs This repository contains .NET Documentation. Contribute to dotnet/docs development by creating an account on GitHub.

Egor landed yesterday a great document about C# "Unsafe code best practices" https://github.com/dotnet/docs/blob/main/docs/standard/unsafe-code/best-practices.md πŸ“œ

Even if you think you know them, it is a good read as a reminder! 😎

#dotnet #csharp

19.09.2025 09:24 β€” πŸ‘ 8    πŸ” 6    πŸ’¬ 0    πŸ“Œ 0

Hey #dotnet folks! Please share latest deep-dive video to spread the knowledge about async internals and tips&tricks on debugging .NET code!

Your support means the world!

/cc: @scott.hanselman.com, @ardalis.com, @terrajobst.net, @migueldeicaza.bsky.social and every other member of .net community!

23.07.2025 21:30 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Let's debug async/await in C#!
YouTube video by Dissecting The Code Let's debug async/await in C#!

Hey guys.
Async methods might be scary for some, but they're not that complicated if you can debug the async machinery to understand how they work!

This is exactly what I did in the last video - "Let's debug async/await in C#".

youtu.be/oHKyzgGjKHQ?...

23.07.2025 21:20 β€” πŸ‘ 12    πŸ” 3    πŸ’¬ 0    πŸ“Œ 1

Hey #dotnet community! Please share and let's simplify the way we deal with resources in .NET!

/cc: @migueldeicaza.bsky.social, @scott.hanselman.com and other folks, I love to discuss this topic!

You might disagree with my take! But its time to reconsider some old patterns.

11.07.2025 17:59 β€” πŸ‘ 3    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

@steplyakov is following 20 prominent accounts