In .NET 6 the built in Kestrel server controlled how HTTP/2 requests accessed a TCP connection via a lock, this … Continue reading HTTP/2 performance improvements in .NET 7
Category: .NET Core Blog
In .NET 7 we can choose not to use top level statements when creating new projects
Top level statements were introduced in .NET 6 to reduce ‘boilerplate’ code but not everyone likes them. In .NET 7 … Continue reading In .NET 7 we can choose not to use top level statements when creating new projects
HTTP/3 standardized as RFC 9114 and fully supported by .NET 6+
It was a big day for HTTP recently (early June 2022) as HTTP/3 was standardized as RFC 9114… Great to … Continue reading HTTP/3 standardized as RFC 9114 and fully supported by .NET 6+
Performance Improvements when Microsoft upgraded their Exchange Online POP3 windows service to .NET Core 3.1 from .NET Framework
Microsoft saw awesome improvements across several metrics including CPU time when they upgraded their Exchange Online POP3 windows service to … Continue reading Performance Improvements when Microsoft upgraded their Exchange Online POP3 windows service to .NET Core 3.1 from .NET Framework
.NET 6 performance improvements when comparing two arrays using SequenceEquals
There’s some pretty impressive performance improvements in .NET 6 when we are comparing arrays using the LINQ SequenceEqual method. The … Continue reading .NET 6 performance improvements when comparing two arrays using SequenceEquals
Amazing performance improvement in .NET 6 when creating one SortedDictionary from another
The performance improvements when cloning one SortedDictionary from another in .NET 6 compared to .NET 5 are amazing. I’m not … Continue reading Amazing performance improvement in .NET 6 when creating one SortedDictionary from another
ImmutableList performance improvements in .NET 6
Another small but welcome performance improvement in .NET 6 is with item retrieval times when using ImmutableList… It looks like … Continue reading ImmutableList performance improvements in .NET 6
Using declarations in C#8+ can allow us to dispose of resources correctly without increasing nesting levels
Since C#8 we can use single line using declarations which will allow us to dispose of resources at the end of … Continue reading Using declarations in C#8+ can allow us to dispose of resources correctly without increasing nesting levels
How to output the Ratio column when using BenchmarkDotNet
If you’re using BenchmarkDotNet and want to see how other methods compare against a baseline method, set the Baseline attribute … Continue reading How to output the Ratio column when using BenchmarkDotNet
Using aliases in C# to provide shorthand references to types or namespaces
In C# we can use aliases to provide shorthand references to types or namespaces. Aliases can be useful to tidy … Continue reading Using aliases in C# to provide shorthand references to types or namespaces
Declaring and setting multiple variables of the same type in the same statement in C#
Does anyone actually use this variation of declaring variables? I rarely see it. I think its possibly useful in instances … Continue reading Declaring and setting multiple variables of the same type in the same statement in C#
ToString() v nameof() performance comparison when getting a string value from a enum option
The benchmarks (originally published on LinkedIn) below from Guilherme Ferreira show’s that there’s a big performance difference between using ToString() and … Continue reading ToString() v nameof() performance comparison when getting a string value from a enum option
Breaking up long interpolated strings can impact performance in .NET 6
If you’ve created long strings using string interpolation ($) and hit enter to prevent horizontal scroll Visual Studio will + … Continue reading Breaking up long interpolated strings can impact performance in .NET 6
Set List<> initial capacity to improve speed
FYI… setting capacity on a List<> when creating it can avoid a lot of expensive resizing operations. Even if we … Continue reading Set List<> initial capacity to improve speed
How to create a project in Visual Studio to play around with new .NET 6 Minimal APIs
To play around with the new Minimal APIs in .NET 6 you can create a new project using the ‘ASP.NET … Continue reading How to create a project in Visual Studio to play around with new .NET 6 Minimal APIs
33% CPU utilization drop after Azure Active Directory gateway service upgraded to .NET 6
CPU utilization dropped by 33% after Azure Active Directory gateway service moved to .NET 6 recently…
In .NET 6 the ZIP LINQ extension can now support merging three sequences together
In .NET 6 the ZIP LINQ extension can be used to merge elements from three sequences together. Previously it was … Continue reading In .NET 6 the ZIP LINQ extension can now support merging three sequences together
In C# use the nameof() expression so your property, class and namespace references are type safe
In C# if you’re referencing property, class or namespace names in your code use the nameof() expression rather than strings … Continue reading In C# use the nameof() expression so your property, class and namespace references are type safe
In C# use Math.Clamp to force a number between a particular inclusive range
In C# Math.Clamp is a helpful method if you need to force a value to stay within a particular inclusive … Continue reading In C# use Math.Clamp to force a number between a particular inclusive range
StringBuilder performance can be improved in C# by setting its capacity
When using StringBuilder in .NET most of times we likely just use the default constructor StringBuilder()… BUT if we have … Continue reading StringBuilder performance can be improved in C# by setting its capacity
.NET 6 string concatenation performance benchmarks
Since there’s been so many amazing performance improvements in .NET 6 I thought it would be fun to compare different … Continue reading .NET 6 string concatenation performance benchmarks
How to use Azure Cache for Redis in a .NET Core web app
If you need a distributed cache and are planning on deploying your .NET Core web app to Azure, using Azure … Continue reading How to use Azure Cache for Redis in a .NET Core web app
Override the default controller scaffold templates in Visual Studio 2019 and .NET 5.0
The real power of scaffolding in Visual Studio comes from the ability to override the templates which are used to … Continue reading Override the default controller scaffold templates in Visual Studio 2019 and .NET 5.0
Enabling view refresh after .CSHTML changes for new projects in Visual Studio
Since .NET Core 3.0 your views in MVC won’t refresh after you change your .CSHTML markup. You can enable this … Continue reading Enabling view refresh after .CSHTML changes for new projects in Visual Studio
Using ToLower() or ToUpper() in C# to compare strings is not safe in all cultures
If you’re using Resharper, Roslynator or similar you’ll likely see string comparisons using ToLower() or ToUpper() flagged. Why are these … Continue reading Using ToLower() or ToUpper() in C# to compare strings is not safe in all cultures