Skip to content

Instantly share code, notes, and snippets.

View svick's full-sized avatar

Petr Onderka svick

View GitHub Profile
@svick
svick / Program.cs
Last active March 3, 2020 20:04
head-tail sum perf
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Diagnosers;
using BenchmarkDotNet.Running;
public class Program
{
using System.Collections.Generic;
using System.Linq;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
public class Program
{
static void Main() => BenchmarkRunner.Run<Benchmark>();
}
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
public class Program
{
static void Main() => BenchmarkRunner.Run<Benchmark<string>>();
}
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.Serialization.Formatters.Binary;
using static System.Reflection.BindingFlags;
class Program
{
static void Main(string[] args)
>dotnet run -p ..\..\tools\ResultsComparer\ResultsComparer.csproj --base .\before\ --diff .\after\ --threshold 3%
summary:
better: 65, geomean: 1.629
worse: 10, geomean: 1.548
total diff: 75
Slower diff/base Base Median (ns) Diff Median (ns) Modality
using System;
using System.Reflection;
using System.Reflection.Emit;
class Program
{
static void Main()
{
var assembly = AssemblyBuilder.DefineDynamicAssembly(new AssemblyName("a.dll"), AssemblyBuilderAccess.Run);
var module = assembly.DefineDynamicModule("a.dll");
class DelayTaskSource
{
readonly ValueTaskSource valueTaskSource;
readonly object l = new object();
readonly List<(Action<object>, object, short)> continuations = new List<(Action<object>, object, short)>();
readonly Dictionary<short, long> timestamps = new Dictionary<short, long>();
readonly List<short> tokenCache = new List<short>();
readonly Timer timer;
long? timerTimestamp;
short nextToken;
using System;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
struct MethodDesc
{
const ushort enum_flag3_TokenRemainderMask = 0x3FFF;
static readonly int ALIGNMENT_SHIFT = 3;
static readonly int ALIGNMENT = (1<<ALIGNMENT_SHIFT);
dotnet complete "dotnet add package Mic"
MicCodes.ECharts
MicCodes.Logger
MicCodes.Notify
MicCodes.Sms
MicCodes.Sms.Core
MicCodes.Storage
MicCodes.Tasks
MicDrop
MIConvexHull
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using coremvcapp.Models;
using System.Net;
using System.Runtime.CompilerServices;