Kevin Gosse
banner
kevingosse.net
Kevin Gosse
@kevingosse.net
1.1K followers 680 following 1.3K posts
Principal engineer at JetBrains, passionate about .NET, performance, and debugging. Microsoft MVP. Co-author of Pro .NET Memory Management (2nd edition)
Posts Media Videos Starter Packs
Another way to illustrate: here, CallMe is able to extract the string "hello" even though it feels like it shouldn't be able to.
True! I never realized before seeing your post.
If you have trouble understanding what's going on, have a look at the decompiled code. `Test` allocates a single closure for the calls to `CallMe1` and `CallMe2`.
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.
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.
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.
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...
See the quoted thread 🙂
bsky.app/profile/kevi...
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>.
Was it 2025.2.1? 🤔
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!
Not entirely sure what I'm going to do with all that money.
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...
It's trying hard
Yeah, gonna be one of those days.
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.
Some of the work might end up impacting Rider as a large part of the codebase is shared, but yeah my main focus right now is Resharper 😅
For reference, when running the same test with vanilla VS (no extensions), the cumulated duration of freezes is ~6 seconds. It means Resharper is still adding ~3 seconds even in out-of-process mode. We will try our best to reduce it further in the upcoming versions.
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.
If I trust this comment, it's because with NGEN, generic type specializations can live in a different assembly. So when resolving a generic, .NET scans the assemblies to deduplicate them.
github.com/dotnet/corec...
github.com