Skip to content

Instantly share code, notes, and snippets.

View Henr1k80's full-sized avatar

Henrik Henr1k80

View GitHub Profile
@Henr1k80
Henr1k80 / Program.cs
Created March 3, 2023 10:12
Benchmark of CollectionsMarshal.AsSpan with PGO
using System.Runtime.InteropServices;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Jobs;
using BenchmarkDotNet.Reports;
using BenchmarkDotNet.Running;
Summary? summary = BenchmarkRunner.Run<AsSpanBenchmark>();
[MemoryDiagnoser]
@Henr1k80
Henr1k80 / Program.cs
Created January 13, 2023 23:22
Benchmark of cast to IEnumerable<int> vs call of the extension method .AsEnumerable()
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Jobs;
using BenchmarkDotNet.Running;
using Cysharp.Text;
BenchmarkRunner.Run<CastVsAsEnumerable>();
[MemoryDiagnoser]
[SimpleJob(RuntimeMoniker.Net60)]
public class CastVsAsEnumerable
@Henr1k80
Henr1k80 / Program.cs
Created November 18, 2022 10:59
Benchmark of CollectionsMarshal.AsSpan
using System.Runtime.InteropServices;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Jobs;
using BenchmarkDotNet.Reports;
using BenchmarkDotNet.Running;
Summary? summary = BenchmarkRunner.Run<AsSpanBenchmark>();
[MemoryDiagnoser]
[SimpleJob(RuntimeMoniker.Net60)]