Skip to content

Instantly share code, notes, and snippets.

View EgorBo's full-sized avatar
🛠️
Working from home

Egor Bogatov EgorBo

🛠️
Working from home
View GitHub Profile

benchmarks.run.windows.arm64.checked.mch:


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 7603860 (overridden on cmd)
Total bytes of diff: 7582960 (overridden on cmd)
Total bytes of delta: -20900 (-0.27 % of base)
@EgorBo
EgorBo / dotnet-runtime-commit.cs
Created November 7, 2021 16:09
dotnet-runtime-commit.cs
using System.Diagnostics;
using System.Text.RegularExpressions;
using System.Xml.Linq;
class Program
{
static void Main() => Console.WriteLine($"dotnet/runtime commit: {GetDotnetRuntimeCommit()}");
public static string GetDotnetRuntimeCommit()
{
@EgorBo
EgorBo / GDV_for_delegates.cs
Last active June 17, 2022 08:02
GDV_for_delegates.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Jobs;
using BenchmarkDotNet.Running;
//
@EgorBo
EgorBo / ConstextInsensitivePGO.cs
Created October 27, 2021 12:04
ConstextInsensitivePGO.cs
using System;
using System.Threading;
public class Prog
{
static void DoWorkCommon(JobFactory factory, int i) => factory.CreateJob(i).DoWork();
static void DoWork1(JobFactory factory) => DoWorkCommon(factory, 1);
static void DoWork2(JobFactory factory) => DoWorkCommon(factory, 2);
@EgorBo
EgorBo / vpopcnt.cs
Created October 21, 2021 23:10
vpopcnt.cs
static Vector128<uint> VPopcnt(Vector128<uint> dataArg)
{
var data = dataArg; // workaround for a codegen issue
data = Sse2.Subtract(data, Sse2.And(Sse2.ShiftRightLogical(data, 1), Vector128.Create((uint)0x55555555)));
data = Sse2.Add(Sse2.And(data, Vector128.Create((uint)0x33333333)),
Sse2.And(Sse2.ShiftRightLogical(data, 2), Vector128.Create((uint)0x33333333)));
data = Sse2.And(Sse2.Add(data, Sse2.ShiftRightLogical(data, 4)), Vector128.Create((uint)0x0F0F0F0F));
data = Sse2.Add(data, Sse2.ShiftRightLogical(data, 8));
data = Sse2.Add(data, Sse2.ShiftRightLogical(data, 16));
data = Sse2.And(data, Vector128.Create((uint)0x0000003F));
@EgorBo
EgorBo / Volatile-vs-volatile.cs
Created October 10, 2021 14:36
Volatile-vs-volatile.cs
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Runtime.Intrinsics.Arm;
using System.Threading;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Order;
using BenchmarkDotNet.Running;
@EgorBo
EgorBo / trie.cs
Created September 9, 2021 15:53
trie.cs
using BenchmarkDotNet.Attributes;
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
public class Program
{
public static void Main()
{
BenchmarkDotNet.Running.BenchmarkRunner.Run<Program>();
@EgorBo
EgorBo / old.asm
Created July 20, 2021 21:42
old.asm
; Assembly listing for method Tests:Test(ClassAFactoryFactory):long
; Emitting BLENDED_CODE for X64 CPU with SSE2 - Windows
; ReadyToRun compilation
; optimized code
; rsp based frame
; partially interruptible
; No PGO data
; Final local variable assignments
;
; V00 arg0 [V00,T00] ( 4, 3.50) ref -> rcx class-hnd single-def
@EgorBo
EgorBo / new.asm
Created July 20, 2021 21:41
new.asm
; Assembly listing for method Tests:Test(ClassAFactoryFactory):long
; Emitting BLENDED_CODE for X64 CPU with SSE2 - Windows
; ReadyToRun compilation
; optimized code
; optimized using profile data
; rsp based frame
; partially interruptible
; with PGO: edge weights are valid, and fgCalledCount is 2e+08
; 0 inlinees with PGO data; 3 single block inlinees; 0 inlinees without PGO data
; Final local variable assignments
@EgorBo
EgorBo / TypeChecks.cs
Last active July 18, 2021 12:21
TypeChecks.cs
using BenchmarkDotNet.Attributes;
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using BenchmarkDotNet.Running;
public class Program
{
static void Main(string[] args)