Showing tag results for seteplia

May 9, 2017
Post comments count0
Post likes count0

Garbage collection and variable lifetime tracking

Sergey Tepliakov
Sergey Tepliakov

Here is a seemingly simple question for you: Is it possible that the CLR will call a finalizer for an instance when an instance method is still running? In other words, is it possible in the following case to see ‘Finalizing instance.’ before ‘Finished doing something.’? The answer is: “It depends”. In debug builds this will never happen (as far...

seteplia
Feb 21, 2017
Post comments count0
Post likes count0

A common execution path optimization

Sergey Tepliakov
Sergey Tepliakov

Today I want to talk about one interesting optimization pattern that you may face in framework code or in high-performance libraries. The idea is simple: suppose you have a commonly used method that has two execution paths – one is very common and simple, and the second one takes longer to execute, has more steps but happens not that often. A...

seteplia
Feb 1, 2017
Post comments count0
Post likes count0

Dissecting the new() constraint in C#: a perfect example of a leaky abstraction

Sergey Tepliakov
Sergey Tepliakov

Most likely you’ve heard about The Law of Leaky Abstractions coined by Joel Spolsky. Even if you never heard of it, you definitely faced it in your day-to-day job. The “law” is pretty simple: “All non-trivial abstractions, to some degree, are leaky”. And this is 100% true. But sometimes even not that complicated abstractions can leak their internal...

seteplia
Jan 5, 2017
Post comments count2
Post likes count1

Understanding different GC modes with Concurrency Visualizer

Sergey Tepliakov
Sergey Tepliakov

In this post I’m going to visualize what exactly happens during Garbage Collection (GC) and how different GC modes can significantly affect application performance. I assume that the reader is familiar with garbage collection basics. If this isn’t the case I encourage you to spend 15 minutes to fill this gap, for instance from the following article...

seteplia
Dec 20, 2016
Post comments count0
Post likes count0

Dissecting the ActionBlock: a Short Story About a Nasty Deadlock

Sergey Tepliakov
Sergey Tepliakov

I think almost every project in the real world uses some form of producer-consumer queue. The idea behind this problem is very simple. Application needs to decouple consumers of some data from the logic that processes it. Consider, for instance, the thread pool from the CLR: application can schedule some work using ThreadPool.QueueUserWorkItem and ...

seteplia
Dec 20, 2016
Post comments count0
Post likes count0

Dissecting the code: yet another programmer’s blog

Sergey Tepliakov
Sergey Tepliakov

Hi everyone. My name is Sergey Tepliakov; I’m Senior Software Engineer at TSE(*) team at Microsoft. At my day-to-day job I’m working on a next-gen build engine with tons of very useful capabilities. But don’t worry, I’m not going to dig into this topic. At least for now:) Before joining Microsoft 2 years ago, I’ve been a Microsoft C# MVP. And here ...

seteplia