Skip to main content

dotnet

.NET Core, BenchmarkDotNet: for vs foreach performance

·581 words·3 mins
So what is faster: looping through a List<> with for or with foreach? Today I’ll show you how to use BenchmarkDotNet with .Net Core to answer that question. Let’s start: Create a folder for your new project # Open a command prompt an run:

.NET Core, BenchmarkDotNet and string compare performance

·489 words·3 mins
You have to choose between using string.compare or == to compare strings. How would you know which method performs faster? Today I’ll show you how to use BenchmarkDotNet with .Net Core to answer that question. Let’s start: Create a folder for your new project # Open a command prompt an run: