Skip to content

Instantly share code, notes, and snippets.

View hez2010's full-sized avatar
🎯
Focusing

Steve hez2010

🎯
Focusing
  • Game Developer
  • Tokyo, Japan
View GitHub Profile
@hez2010
hez2010 / benchmarks.cs
Created December 14, 2025 09:55
benchmarks.cs
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
public class Benchmarks
{
private static unsafe void* Malloc(nuint size, nuint alignment)
{
return NativeMemory.AlignedAlloc(size, alignment);
}
@hez2010
hez2010 / devirted_gvm.md
Last active February 19, 2025 05:43
Devirtualized Generic Virtual Methods in PMI

ASP.NET Core + EntityFrameworkCore + BCL + Several Common Libraries in Web Dev

Stats

Total Hit: 226

Unique Hit: 131

Unique Hit

@hez2010
hez2010 / pdqsort_benchmark.cs
Last active February 14, 2026 18:03
PdqSort C# Port
// PdqSort: https://github.com/orlp/pdqsort
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Environments;
using BenchmarkDotNet.Jobs;
using BenchmarkDotNet.Running;
@hez2010
hez2010 / Results.md
Created August 23, 2021 11:01
osu.Framework Benchmark Results

Config

BenchmarkDotNet=v0.13.1, OS=ubuntu 20.04
Intel Xeon Platinum 8171M CPU 2.60GHz, 1 CPU, 2 logical and 2 physical cores
.NET SDK=6.0.100-rc.2.21420.30
  [Host]            : .NET 5.0.9 (5.0.921.35908), X64 RyuJIT
  .NET 5.0          : .NET 5.0.9 (5.0.921.35908), X64 RyuJIT
  .NET 6.0          : .NET 6.0.0 (6.0.21.42010), X64 RyuJIT
 .NET 6.0 PGO + EA : .NET 6.0.0 (6.0.21.42010), X64 RyuJIT, EnvVars(DOTNET_JitObjectStackAllocation=1,DOTNET_TieredPgo=1,DOTNET_ReadyToRun=0,DOTNET_TC_QuickJitForLoops=1)
@hez2010
hez2010 / Integer.cs
Last active August 12, 2021 04:31
Peano's Natural using C# 10
var a = Nat.FromNumber(5);
a++; a++; a++; a++;
var b = Nat.FromNumber(20);
var c = a + b;
var d = Nat.FromNumber(2);
var e = b * c;
e--;
var f = c / d;
Console.WriteLine((e + f).ToNumber<int>()); // 593
@hez2010
hez2010 / Monaco.cs
Last active March 1, 2021 11:19
monaco-editor 0.22.3 C# type bindings, most type bindings are auto-generated with TypedocConverter: https://github.com/hez2010/TypedocConverter
using IColors = System.Collections.Generic.IDictionary<string, string>;
using HTMLElement = System.Object;
using Element = System.Object;
using KeyboardEvent = System.Object;
using MouseEvent = System.Object;
using CharacterPair = System.ValueTuple<string, string>;
using Definition = Monaco.Languages.LocationLink;
using IMonarchLanguageRule = Monaco.Languages.IExpandedMonarchLanguageRule;
using BroswerWorker = System.Object;
@hez2010
hez2010 / Nat.cs
Last active November 23, 2020 04:15
Nat Emulation in C#
using System;
namespace NatEmulation
{
public abstract record Nat()
{
public static Nat operator +(Nat left, Nat right) =>
left switch
{
Zero => right,