Skip to content

Instantly share code, notes, and snippets.

View eerhardt's full-sized avatar

Eric Erhardt eerhardt

View GitHub Profile
[Benchmark]
public void IndexOfShort_Match()
{
"Hello World!".IndexOf('o');
"Hello World!".IndexOf('e');
"Hello World!".IndexOf('!');
}
[Benchmark]
public void IndexOfShort_Miss()
@eerhardt
eerhardt / options.md
Last active March 19, 2018 21:05
Build Options

Build Options

Option 1a:

  • Linux-x64
    • build/publish native assets
  • OSX-x64
    • build/publish native assets
  • Win-x64
  • build/publish native assets
@eerhardt
eerhardt / Program.cs
Created June 4, 2018 21:24
Complex Division Benchmark
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
using System;
using System.Numerics;
namespace ComplexBenchmark
{
public class Program
{
public static void Main(string[] args)
@eerhardt
eerhardt / IntrinsicsTest.csproj
Last active June 5, 2018 22:49
CPUMath vs Hardware Intrinsics Benchmark
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.10.14" />
@eerhardt
eerhardt / Program.cs
Created June 25, 2018 15:45
Parallel.For benchmark
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
using System;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
namespace ParallelForBenchmark
{
class Program
{
@eerhardt
eerhardt / DataView.cs
Created February 7, 2019 20:43
DataView Proposal
namespace Microsoft.Data.DataView {
public sealed class BooleanDataViewType : PrimitiveDataViewType {
public static BooleanDataViewType Instance { get; }
public override bool Equals(DataViewType other);
public override string ToString();
}
public abstract class DataViewRow : IDisposable {
protected DataViewRow();
public abstract long Batch { get; }
public abstract long Position { get; }
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
using Microsoft.Azure.Amqp;
using Microsoft.Azure.Amqp.Encoding;
using System;
using System.Runtime.InteropServices;
[MemoryDiagnoser]
public class AmqpBench
{
@eerhardt
eerhardt / ASP.NET NativeAOT Size Report.md
Last active December 1, 2022 02:08
App size report for NativeAOT ASP.NET app

Key Takeaways

By making changes in the following areas, I believe we can cut somewhere between 6 - 8 MB of size on disk of the 32 MB Albums Linux NativeAOT app.

  1. Compression - 1.1 MB
  2. System.Text.Json - ~2 MB
  3. Regex - 1.2 MB
  4. Linq.Expresions - 1.1 MB
  5. Non-Required Dependencies - ~2 MB