Skip to content

Instantly share code, notes, and snippets.

@nietras
nietras / RemoveInstanceIdFromQueryStringTest.cs
Created July 12, 2023 12:06
David Fowler RemoveInstanceIdFromQuery C# Optimization Challenge
using System;
using System.Runtime.InteropServices;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace RemoveInstanceIdFromQueryStringTest;
[TestClass]
public class RemoveInstanceIdFromQueryStringTest
{
// David Fowler tweet https://twitter.com/davidfowl/status/1678738294933159937
BenchmarkDotNet=v0.12.0, OS=Windows 10.0.17763.1039 (1809/October2018Update/Redstone5)
Intel Core i7-8700 CPU 3.20GHz (Coffee Lake), 1 CPU, 12 logical and 6 physical cores
.NET Core SDK=5.0.100-preview.1.20155.7
  [Host]     : .NET Core 3.1.2 (CoreCLR 4.700.20.6602, CoreFX 4.700.20.6702), X64 RyuJIT
  DefaultJob : .NET Core 3.1.2 (CoreCLR 4.700.20.6602, CoreFX 4.700.20.6702), X64 RyuJIT

BenchmarkDotNet=v0.11.3.1003-nightly, OS=Windows 10.0.17763.503 (1809/October2018Update/Redstone5)
Intel Core i7-8700 CPU 3.20GHz (Coffee Lake), 1 CPU, 12 logical and 6 physical cores
.NET Core SDK=3.0.100-preview5-011568
  [Host]     : .NET Core 3.0.0-preview5-27626-15 (CoreCLR 4.6.27622.75, CoreFX 4.700.19.22408), 64bit RyuJIT
  Job-VKBMMT : .NET Core ? (CoreCLR 4.700.19.30301, CoreFX 4.700.19.27908), 64bit RyuJIT
  Job-SABOCD : .NET Core ? (CoreCLR 4.700.19.30301, CoreFX 4.700.19.27908), 64bit RyuJIT

Runtime=Core InvocationCount=25000 IterationTime=250.0000 ms 
BenchmarkDotNet=v0.11.3.1003-nightly, OS=Windows 10.0.17763.503 (1809/October2018Update/Redstone5)
Intel Core i7-8700 CPU 3.20GHz (Coffee Lake), 1 CPU, 12 logical and 6 physical cores
.NET Core SDK=3.0.100-preview5-011568
  [Host]     : .NET Core 3.0.0-preview5-27626-15 (CoreCLR 4.6.27622.75, CoreFX 4.700.19.22408), 64bit RyuJIT
  Job-JTKJDV : .NET Core ? (CoreCLR 4.6.27803.0, CoreFX 4.700.19.22901), 64bit RyuJIT
  Job-DBBNCI : .NET Core ? (CoreCLR 4.6.27808.0, CoreFX 4.700.19.22901), 64bit RyuJIT

Runtime=Core InvocationCount=10000 IterationTime=250.0000 ms 
@nietras
nietras / System.Collections.Sort_IntClass_-asm.pretty.md
Created May 24, 2019 19:14
Sort Microbenchmark Results IntStruct/IntClass i7-8700

.NET Core ? (CoreCLR 4.6.27803.0, CoreFX 4.700.19.22901), 64bit RyuJIT

; System.Collections.Sort`1[[System.__Canon, System.Private.CoreLib]].Array()
       mov     rcx,qword ptr [rsi+10h]
       mov     edx,dword ptr [rsi+24h]
       lea     eax,[rdx+1]
       mov     dword ptr [rsi+24h],eax
       cmp     edx,dword ptr [rcx+8]
       jae     00007ff8`ef912c7e
 movsxd rdx,edx
Host Process Environment Information:
BenchmarkDotNet=v0.9.8.0
OS=Microsoft Windows NT 6.2.9200.0
Processor=Intel(R) Core(TM) i7-5820K CPU 3.30GHz, ProcessorCount=12
Frequency=3222656 ticks, Resolution=310.3031 ns, Timer=TSC
CLR=MS.NET 4.0.30319.42000, Arch=32-bit RELEASE
GC=Concurrent Workstation
JitModules=clrjit-v4.6.1080.0
@nietras
nietras / CopiesBenchmark-report-github.md
Created August 8, 2016 20:46
Yet another round of memory copy benchmark on .NET (only RyuJIT 64-bit)
Host Process Environment Information:
BenchmarkDotNet=v0.9.8.0
OS=Microsoft Windows NT 6.2.9200.0
Processor=Intel(R) Core(TM) i5-3475S CPU 2.90GHz, ProcessorCount=4
Frequency=2840373 ticks, Resolution=352.0664 ns, Timer=TSC
CLR=MS.NET 4.0.30319.42000, Arch=32-bit RELEASE
GC=Concurrent Workstation
JitModules=clrjit-v4.6.1080.0
@nietras
nietras / CopiesBenchmark-report-github.md
Created August 7, 2016 17:43
Another .NET memory copy benchmark with more details
Host Process Environment Information:
BenchmarkDotNet=v0.9.8.0
OS=Microsoft Windows NT 6.2.9200.0
Processor=Intel(R) Core(TM) i5-3475S CPU 2.90GHz, ProcessorCount=4
Frequency=2840373 ticks, Resolution=352.0664 ns, Timer=TSC
CLR=MS.NET 4.0.30319.42000, Arch=32-bit RELEASE
GC=Concurrent Workstation
JitModules=clrjit-v4.6.1080.0
@nietras
nietras / CopiesBenchmark-report-github.md
Created August 6, 2016 16:13
Detailed memory copy benchmark on .NET
Host Process Environment Information:
BenchmarkDotNet=v0.9.8.0
OS=Microsoft Windows NT 6.2.9200.0
Processor=Intel(R) Core(TM) i5-3475S CPU 2.90GHz, ProcessorCount=4
Frequency=2840372 ticks, Resolution=352.0666 ns, Timer=TSC
CLR=MS.NET 4.0.30319.42000, Arch=32-bit RELEASE
GC=Concurrent Workstation
JitModules=clrjit-v4.6.1080.0
@nietras
nietras / CopiesBenchmark-report-github.md
Created August 6, 2016 15:57
Early .NET memory copy benchmarks
Host Process Environment Information:
BenchmarkDotNet=v0.9.8.0
OS=Microsoft Windows NT 6.2.9200.0
Processor=Intel(R) Core(TM) i5-3475S CPU 2.90GHz, ProcessorCount=4
Frequency=2840372 ticks, Resolution=352.0666 ns, Timer=TSC
CLR=MS.NET 4.0.30319.42000, Arch=32-bit RELEASE
GC=Concurrent Workstation
JitModules=clrjit-v4.6.1080.0