David Kean

David Kean

@keansbox.com

I make things fast @ Visual Studio, previously NET. He/Him.

813 followers199 following279 posts

David Kean reposted

Been using it since it was released. Rock solid and performance is great. It’s my new daily driver.

David Kean@keansbox.com

Visual Studio 2026 represents about a year's worth of work across the Visual Studio team. If you haven't tried it, head over to visualstudio.microsoft.com/insiders/ to download it - it will install alongside Visual Studio 2022 so you can continue to use both if you like.

Visual Studio 2026 represents about a year's worth of work across the Visual Studio team. If you haven't tried it, head over to visualstudio.microsoft.com/insiders/ to download it - it will install alongside Visual Studio 2022 so you can continue to use both if you like.

visualstudio.microsoft.comVisual Studio 2026 Insiders - Faster, smarter IDETry Visual Studio 2026 Insiders with Copilot AI deeply integrated, faster performance across C# and C++, and a refreshed, modern UI.

We've been working for a while on a vision of what Visual Studio looks like in the future, and first insiders build of 2026 represents one of our first steps towards that. On top of being gorgeous with its modern Fluent UI, this build one of the fastest releases we've released, with more to come.

David Kean reposted

Gotta say that in other news - I’m really enjoying the new #vs2026 insiders version. Not one crash and now it’s my primary IDE . Seems snappier and cleaner. Great job #VisualStudio team. And shout out to #SSMS team! V21 is breath of fresh air.

One time during .NET Core early days, we were having a remote meeting with Fowler and another colleague of his. This was in the days when video meetings were a bit unusual. His colleague completely forgot he was on video and had a reaction like this to something I said.

David Fowler @davidfowl.com

Caught a snapshot of myself in a meeting reacting to something.

He was embarrassed when he realized as he didn't mean for us to see it. This, however, is David's natural position in a meeting (or at least ones involving me), so you kinda had to get used to it. :)

David Kean reposted

Finally had time over the holidays to realize a long-standing dream of mine: a hex editor that knows about the PE file and .NET metadata format. You can click any byte and it will show you which data structure it is in the tree. Every byte is covered. The parser is at github.com/KirillOsenko...

David Kean reposted

In case you didn't know Visual Studio could do this: #dotnet #csharp

David Wengier@david.wengier.com

It should do that already. It does for me. Even makes the return type Task and adds the using statement, which I forgot about.

David Kean reposted

Did you know that you can define a DebuggerDisplayAttribute for a type from another assembly? Just add an assembly-level attribute to your code and specify the Target type: [assembly: DebuggerDisplay(@"\{Color = {Color}}", Target = typeof(Pen))]

We added a feature to Visual Studio to automatically detect when it uses an unusual amount of CPU. After 20 mins of continuous CPU across all threads combined (and the machine has been sampled), we capture a short trace.

View full thread

On machines with high core count, there was just too much contention, resulting in a degradation of the scenario in a way that burned more CPU due to threads being taken on and off the CPU than actually "real work". This was a real issue, and CPU tracing was vindicated!

So developers from the VS team that follow me, if you are reading this thread and think you might *actually* have an exception to my CPU tracing is always right rule, don't be offended if I don't take that at face value...

We added a feature to Visual Studio to automatically detect when it uses an unusual amount of CPU. After 20 mins of continuous CPU across all threads combined (and the machine has been sampled), we capture a short trace.

View full thread

But here I could see this lock consuming CPU due to Windows context switching. This is the overhead of moving threads on and off the CPU. It's usually a tiny overhead in the scheme of things, but here I could not only see it showing up, but i could see 90% of the CPU used was just context switching.

I looked at the code, and sure enough, I saw a few critical sections sprinkled throughout it. When this code ran in the wild, we saw the code fire up as many threads as there were logical CPUs only to immediately hit these locks repeatedly.

We added a feature to Visual Studio to automatically detect when it uses an unusual amount of CPU. After 20 mins of continuous CPU across all threads combined (and the machine has been sampled), we capture a short trace.

View full thread

I went to close the bug and agree that this was actually a legitimate use case and privately lament that the "always right" of CPU tracing no longer held. But then I noticed something...

On one of the call stacks, I saw the code entering a critical section, or lock. This is not super unsual for stacks in our data to show locks, but it was usual for this to show up in our CPU data. Locks are situations when the code has been taken *off* the CPU and hence shouldn't be consuming any.

We added a feature to Visual Studio to automatically detect when it uses an unusual amount of CPU. After 20 mins of continuous CPU across all threads combined (and the machine has been sampled), we capture a short trace.

View full thread

That is until today. I came across a resolved issue that had been marked as by design; this code legitimately spanned itself across a lot of cores with the intention of getting through this user triggered process really quickly.

And indeed, I could see that. The bursts were short, but CPU heavy that on a machine with a lot of cores but large enough dataset it could easily burn through the quota.

We added a feature to Visual Studio to automatically detect when it uses an unusual amount of CPU. After 20 mins of continuous CPU across all threads combined (and the machine has been sampled), we capture a short trace.

View full thread

This doesn’t stop VS devs and extension authors, however, from trying to convince me that their feature is special and that they intentionally use that much CPU for their algorithm.

Nope, always a bug. I have built some nice-looking dashboards that help visualize CPU usage over a session that really goes far in convincing folks and brings the point home easily.

We added a feature to Visual Studio to automatically detect when it uses an unusual amount of CPU. After 20 mins of continuous CPU across all threads combined (and the machine has been sampled), we capture a short trace.

View full thread

It's a nice little system and resulted in a release to release decrease in CPU usage across the board for Visual Studio. It also captured some bugs that have been around forever that we would never have seen, let alone fixed without it having captured the issue.

One property I didn’t expect when we turned the feature on, was that every issue the system captured represented an actual bug or design issue with VS. I've yet to see a real legitimate use of that much CPU.

We added a feature to Visual Studio to automatically detect when it uses an unusual amount of CPU. After 20 mins of continuous CPU across all threads combined (and the machine has been sampled), we capture a short trace.

This gets uploaded via the same pipeline that backs Windows Crash reporting. This then gets analyzed, aggregated into bug level failures, which is then ranked by hit count and impact and assigned out to teams.

I spend my day breaking builds, so thankful that these folks are there to pick up the pieces, including @kirillosenkov.com himself who has written the best tool to diagnose them msbuildlog.com!

msbuildlog.comMSBuild Log Viewer
Kirill Osenkov@kirillosenkov.com

When @nickcraver.com joined Microsoft I was curious what he will naturally gravitate towards after he looks around. Nick looked around and decided to fix builds! When @nguerrera.dev joined Microsoft, I already knew what he will deem to be most impactful task for starters: fixing builds!

If there just one one skill or attribute that I think early in career folks should focus on, it would be, "be curious". This isn't "questioning every decision"-curious, but the "I wonder why it works this way, let me figure that out"-curious.