Kevin Gosse
banner
kevingosse.net
Kevin Gosse
@kevingosse.net
Principal engineer at JetBrains, passionate about .NET, performance, and debugging. Microsoft MVP. Co-author of Pro .NET Memory Management (2nd edition)
Fun fact: you can't use print screen to capture a screenshot of a crash of SnippingTool
November 6, 2025 at 8:31 AM
Reposted by Kevin Gosse
#UCP25 | Kevin Gosse - The Hidden Life of Method Calls

Kevin reveals in his session what really happens when your code runs:
➡️ calling conventions
➡️ stack frames
➡️ JIT compilation
➡️ virtual dispatch
➡️ CPU-level mechanics

➡️ prague.updateconf.net

#DotNet #Performance @kevingosse.net @woodruff.dev
November 6, 2025 at 8:11 AM
I had a ton of fun at Techorama NL. It's not everyday that you get a chance to debug variadic .NET functions on a giant movie theater screen.
November 1, 2025 at 9:35 AM
We are getting closer to the release of Resharper 2025.3 , so I ran some performance tests to see how much we improved compared to 2025.2.

For this iteration, I focused my effort mainly on the huge Datadog.Trace solution, available on the DataDog/dd-trace-dotnet repository.

Results below 👇
October 30, 2025 at 7:04 PM
I just published a new article: Using profiler function hooks in .NET with Silhouette.
In the process, we also learn how to use static linking with NativeAOT.

minidump.net/using-functi...
Using profiler function hooks in .NET with Silhouette
In this article, we see what are function hooks, and how to use them in .NET with Silhouette. We also learn how to statically link a library with NativeAOT.
minidump.net
October 21, 2025 at 11:49 AM
Reposted by Kevin Gosse
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...
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…
randomascii.wordpress.com
October 9, 2025 at 8:27 PM
There's an even more adverse effect to the way closures are allocated:
sharplab.io#v2:EYLgxg9gT...

Because the same closure is reused for different calls, you can end up extending the lifetime of some of your objects without realizing it.
September 26, 2025 at 1:28 PM
Top thing I wish I had known earlier as a software engineer: before leaving a company, make sure to download your favorite slack emojis, so you don't have to frenetically look for them on the web when you realize they're missing from the new slack.
September 24, 2025 at 7:18 AM
Worked at Datadog, encountered crashes because of mysterious race-conditions in .NET writeable metadata: github.com/dotnet/runti...

Moved to JetBrains, encountered crashes because of mysterious race-conditions in .NET writeable metadata: github.com/dotnet/runti...

I think I'm cursed.
September 22, 2025 at 3:14 PM
As requested, I published an article about how the UI profiler works: minidump.net/measuring-ui...
It allows me to measure the responsiveness of Visual Studio when running with ReSharper, in various conditions.

I also made the source code available on github: github.com/kevingosse/U...
September 18, 2025 at 12:54 PM
Congrats to Microsoft on this new release, I've been using it for a few weeks now and it really feels great.

Note that Resharper is already compatible, if you want to try it!
September 10, 2025 at 7:01 AM
Not entirely sure what I'm going to do with all that money.
September 3, 2025 at 10:02 AM
I just discovered that whenever you create a closure in a generic C# method, the closure is also generic even when it's not needed.

This is very frustrating to me because generics cause performance issues in Resharper (see bsky.app/profile/kevi...)

sharplab.io#v2:EYLgxg9gT...
September 1, 2025 at 2:55 PM
Monday
September 1, 2025 at 8:10 AM
I can't recommend strongly enough to use an unlimited online backup service (I use @backblaze.bsky.social). Backup your whole disk and forget about it.
Just today, I realized I lost some code I wrote months ago (~2 days of work). Painlessly restored it from the automatic backup.
August 28, 2025 at 3:14 PM
To help reduce the number of UI freezes caused by Resharper, I built an internal tool to measure UI responsiveness.
Here, you can see the improvement between the current 2025.1 version (on the left) and the upcoming 2025.2 version (on the right) with out-of-process enabled.
July 28, 2025 at 12:58 PM
As I work on Resharper performance, I learn about limitations of .NET (at least, .NET Framework) that I wasn't aware of. Here, I shaved 1 second of CPU time on startup by... removing a call to Array.Empty<T>.
July 23, 2025 at 10:31 AM
Working on performance, it's a lot of time wasted on dead-ends and getting the impression of making no progress, and then suddenly managing to shave 10 seconds of CPU time off R# startup.
July 18, 2025 at 3:21 PM
One thing I like about working on a new codebase is finding all those low-hanging fruits, optimizations that have a significant impact for a relatively low effort.

Here, before/after, squashing ~140 MB of heap allocations from Resharper licensing code.
July 8, 2025 at 10:17 AM
I really enjoyed participating to the last 2codeOrNot2code, so I'm happy to repeat the experience. This time, we will have some fun with functions, unveiling interesting details about what happens when you call them. If you like to understand how things work, don't miss it!
July 8, 2025 at 7:36 AM
I'm experimenting with interfacing dnlib with my Silhouette library. The .NET profiling API provides almost no helper at all to manipulate IL, it just exposes the method body as a binary blob. Having access to dnlib greatly simplifies IL rewriting.

github.com/kevingosse/S...
July 5, 2025 at 3:00 PM
I released v2.0.0 of Silhouette, my library to write .NET profilers in C#. The main change is the addition of IMetadataImport2. There are a few small breaking changes, so I'm embracing semver and bumping the major version number.
github.com/kevingosse/S...
Release v2.0.0 · kevingosse/Silhouette
Added IMetadataImport2 interface Breaking changes: Removed the KnownGuids class. The GUIDs are now available from their respective interfaces. ICorProfilerInfo.GetModuleMetaData now returns an In...
github.com
June 22, 2025 at 9:43 AM
sourceof.net now redirects to github.com/microsoft/re.... I really hope Microsoft will reconsider this change, code navigation on Github isn't even remotely as good as what we had before (basically source.dot.net but for .NET Framework)
GitHub - microsoft/referencesource: Source from the Microsoft .NET Reference Source that represent a subset of the .NET Framework
Source from the Microsoft .NET Reference Source that represent a subset of the .NET Framework - microsoft/referencesource
sourceof.net
June 21, 2025 at 7:20 AM
I've been playing with "Next edit suggestions" in Visual Studio (devblogs.microsoft.com/visualstudio...) and in my opinion it crosses the fine line between "useful AI" and "noisy AI". Too many irrelevant suggestions, and hard to ignore without pressing esc. I hope they can tone it down.
Next edit suggestions available in Visual Studio GitHub Copilot - Visual Studio Blog
Next edit suggestions in Visual Studio 2022 help predict logical code edits, improving refactoring, syntax updates, and editing flow with GitHub Copilot.
devblogs.microsoft.com
June 11, 2025 at 7:49 AM
Today I needed some information about method jitting in R#, but ETW was missing some bits. It was a nice opportunity to test Silhouette, and it only took me a few hours to write a profiler to retrieve everything I needed.

(and yes, it's XML, I'm old 👴)
May 23, 2025 at 3:46 PM