Using the Params attribute in BenchmarkDotNet is really useful as it allows us to get benchmark results for each combination … Continue reading Group benchmarks by method when using Params in BenchmarkDotNet
Category: .NET Core Blog
How to have a GlobalSetup per benchmark in BenchmarkDotNet
If we are using BenchmarkDotNet and want to have a different setup method for each benchmark or groups of benchmarks … Continue reading How to have a GlobalSetup per benchmark in BenchmarkDotNet
.NET 6 v .NET 7 reflection performance benchmarks
.NET 7 (Preview 5+) has some awesome performance improvements when it comes to reflection functionality like invoking methods BUT there … Continue reading .NET 6 v .NET 7 reflection performance benchmarks
How to benchmark different versions of the same library with BenchmarkDotNet
If you want to benchmark the performance of two or more versions of the same library against each other you … Continue reading How to benchmark different versions of the same library with BenchmarkDotNet
Running BenchmarkDotNet benchmarks against .NET 7
.NET 7 will be released in November 2022. If you want to run performance benchmarks against it using BenchmarkDotNet you … Continue reading Running BenchmarkDotNet benchmarks against .NET 7
How to turn off and disable Global Usings in Visual Studio
Not everyone is a fan of Global Usings which were released with C# 10 in November 2021. Since the templates … Continue reading How to turn off and disable Global Usings in Visual Studio
How to run benchmarks against multiple versions of .NET with BenchmarkDotNet
If you’re into this sort of stuff like me it can be fun to run benchmarks against bits of code … Continue reading How to run benchmarks against multiple versions of .NET with BenchmarkDotNet
Regular Expressions using RegexOptions.IgnoreCase slower than inline case insensitive pattern syntax in .NET 6
RegexOptions.IgnoreCase often offers better readability and expression of intent than inline pattern matching. We can see examples of the two … Continue reading Regular Expressions using RegexOptions.IgnoreCase slower than inline case insensitive pattern syntax in .NET 6
Three examples of Regular Expression performance improvements in .NET 7
Stephens Toubs performance articles on devblogs.microsoft.com are always something I look forward to. In May 2022 he wrote one covering … Continue reading Three examples of Regular Expression performance improvements in .NET 7
Microseconds and Nanoseconds available in .NET 7
Currently developers have to perform calculations on the Ticks property to calculate microseconds and nanoseconds. .NET 7 will address this … Continue reading Microseconds and Nanoseconds available in .NET 7
.NET 6 can capture W3C format server logs for our web apps
.NET 6 added the ability for us to capture server access logs in W3C extended log file format (IIS default) … Continue reading .NET 6 can capture W3C format server logs for our web apps
Use C# 10 Global Usings to make namespaces available to all files in a project
Global Usings in C# 10 allow us to declare a namespace as being available to all files in a project … Continue reading Use C# 10 Global Usings to make namespaces available to all files in a project
Use file-level namespaces in C# 10 to reduce vertical nesting
In C# 9 we saw how top-level statements can help us reduce ‘wasted’ vertical space… BUT… reducing ‘wasted’ horizontal space … Continue reading Use file-level namespaces in C# 10 to reduce vertical nesting
.NET 6 has new MaxBy extension method for finding max value of a property in a collection
MaxBy is a nice LINQ extension which was released as part of .NET 6 in November 2021. It allows us … Continue reading .NET 6 has new MaxBy extension method for finding max value of a property in a collection
String.Join performance has improved in .NET 6
In C#, String.Join is very useful to get a delimiter separated string from a string list. This is another method … Continue reading String.Join performance has improved in .NET 6
String.Replace performance improvements in .NET 6
The below String.Replace benchmarks show some solid performance improvements between .NET 5 v .NET 6… I’ve included other runtimes too … Continue reading String.Replace performance improvements in .NET 6
In .NET 6 we can set default return values for FirstOrDefault(), LastOrDefault() and SingleOrDefault()
.NET 6 has a few LINQ improvements. One of them is support for custom default return values for FirstOrDefault(), LastOrDefault() … Continue reading In .NET 6 we can set default return values for FirstOrDefault(), LastOrDefault() and SingleOrDefault()
DateTime.UtcNow and DateTime.Now performance improvements in .NET 6
DateTime.UtcNow is significantly faster in .NET 6 compared to .NET 5. The performance improvement mainly comes from negating the regressions … Continue reading DateTime.UtcNow and DateTime.Now performance improvements in .NET 6
Consider using named arguments in C# to increase readability of method calls
By using named arguments in C# we don’t have to match the ordering of parameter lists of called methods. Instead the … Continue reading Consider using named arguments in C# to increase readability of method calls
Poll Results : Do you have a use case for CoreWCF?
CoreWCF is a port of WCF to .NET Core. It’s a community project but will be supported by Microsoft and … Continue reading Poll Results : Do you have a use case for CoreWCF?
.NET 7 to include new ThrowIfNullOrEmpty ArgumentException guard clause
In .NET 6 Microsoft introduced the ArgumentException.ThrowIfNull guard clause and in .NET 7 (Preview 4) they have introduced ArgumentException.ThrowIfNullOrEmpty. Using … Continue reading .NET 7 to include new ThrowIfNullOrEmpty ArgumentException guard clause
.NET 7 (Preview) available on Azure App Service as extension
.NET 7 will be released in November and as of the time of writing we are on Preview 5. If … Continue reading .NET 7 (Preview) available on Azure App Service as extension
System.Random is much faster in .NET 6 as Microsoft have changed underlying algorithm
In .NET 6 Microsoft have changed the algorithm used in System.Random and the performance improvements are crazy. Check out the … Continue reading System.Random is much faster in .NET 6 as Microsoft have changed underlying algorithm
Emojis will be supported in .NET 7 console output
In .NET 7 it will be possible to use emojis in console output. What do you think about this? Good? … Continue reading Emojis will be supported in .NET 7 console output
Microsoft drops parameter null checking operator from C#11
Looks like Microsoft have pulled the null check !! operator from C#11. It had been included in C# 11 early … Continue reading Microsoft drops parameter null checking operator from C#11