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
@EgorBo
EgorBo / run.ps1
Last active July 14, 2021 23:43
run.ps1
$nettracePath = "C:\prj\net.nettrace"
$mibcPath = "C:\prj\my.mibc"
Remove-Item "bin" -Recurse -ErrorAction Ignore
Remove-Item "obj" -Recurse -ErrorAction Ignore
Remove-Item $nettracePath -Recurse -ErrorAction Ignore
Remove-Item $mibcPath -Recurse -ErrorAction Ignore
dotnet publish -c Release -r win-x64
@EgorBo
EgorBo / Program.cs
Created July 14, 2021 22:47
Program.cs
using System;
using System.Diagnostics;
using System.Runtime.CompilerServices;
public static class Tests
{
static void Main()
{
var ff = new ClassBFactoryFactory();
var sw = Stopwatch.StartNew();
@EgorBo
EgorBo / Classes.cs
Last active July 14, 2021 23:50
Classes.cs
using System;
public class ClassA
{
public virtual long GetValue() => 0;
}
public class ClassB : ClassA
{
long a = 42;
Found 2 files with textual diffs.
Summary of Code Size diffs:
(Lower is better)
Total bytes of base: 3619334
Total bytes of diff: 3805940
Total bytes of delta: 186606 (5.16% of base)
Total relative delta: 2057.87
diff is a regression.
--threshold 1% --noise 10ns
summary:
better: 59, geomean: 1.159
worse: 1, geomean: 1.026
total diff: 60
| Slower | diff/base | Base Median (ns) | Diff Median (ns) | Modality|
| -------------------------------------------------------------------------------- | ---------:| ----------------:| ----------------:| --------:|
| Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks.HPackHeaderWriterBenchmark.B | 1.03 | 815.89 | 837.18 | |
@EgorBo
EgorBo / InlineForest.cs
Created June 3, 2021 18:47
InlineForest.cs
using System.Collections.Generic;
namespace JitInlineInfoComparer
{
public class InlineForest
{
public string Policy { get; set; }
public List<Method> Methods { get; set; }
public override string ToString() => $"InlineForest: {Policy}, {Methods.Count} Methods";
@EgorBo
EgorBo / Win-Default-Egor--vs--Default-Main (Libraries).txt
Created May 29, 2021 10:30
Win-Default-Egor--vs--Default-Main (Libraries).txt
summary:
better: 498, geomean: 1.223
worse: 109, geomean: 1.178
total diff: 610
| Slower | diff/base | Base Median (ns) | Diff Median (ns) | Modality|
| -------------------------------------------------------------------------------- | ---------:| ----------------:| ----------------:| -------- |
| System.Numerics.Tests.Constructor.ConstructorBenchmark_Int16 | 15.25 | 0.36 | 5.44 | |
| MicroBenchmarks.Serializers.Json_ToStream<CollectionsOfPrimitives>.DataContractJ | 1.96 | 1103971.24 | 2168800.00 | |
| MicroBenchmarks.Serializers.Json_ToStream<MyEventsListerViewModel>.DataContractJ | 1.92 | 794602.87 | 1524700.00 | |
@EgorBo
EgorBo / Linux-DynPGO-EgorPR--vs--DynPGO-Main.txt
Created May 28, 2021 16:49
Linux-DynPGO-EgorPR--vs--DynPGO-Main.txt
summary:
better: 281, geomean: 1.159
worse: 1, geomean: 1.102
total diff: 282
// DynPGO:
| Slower | diff/base | Base Median (ns) | Diff Median (ns) | Modality|
| -------------------------------------------------------------------------------- | ---------:| ----------------:| ----------------:| --------:|
| System.Text.Json.Reader.Tests.Perf_Base64.ReadBase64EncodedByteArray_HeavyEscapi | 1.10 | 140.70 | 155.05 | |
@EgorBo
EgorBo / Linux-Default-EgorPR--vs--Default-Main.txt
Created May 28, 2021 16:47
Linux-Default-EgorPR--vs--Default-Main.txt
summary:
better: 169, geomean: 1.128
worse: 2, geomean: 1.131
total diff: 171
// Default:
| Slower | diff/base | Base Median (ns) | Diff Median (ns) | Modality|
| -------------------------------------------------------------------------------- | ---------:| ----------------:| ----------------:| --------:|
| System.Text.Json.Tests.Perf_Guids.WriteGuids(Formatted: False, SkipValidation: F | 1.14 | 5956802.85 | 6790316.74 | |
@EgorBo
EgorBo / PowerShell-benchmarks-PGO-inliner.md
Last active May 27, 2021 22:00
PowerShell-benchmarks-PGO-inliner.md

EgorPR vs Main (both use default options)

| Faster                                                                           | base/diff | Base Median (ns) | Diff Median (ns) | Modality|
| -------------------------------------------------------------------------------- | ---------:| ----------------:| ----------------:| --------:|
| Engine.Scripting.InvokeMethod(InvokeMethodScript: "[System.IO.Path]::HasExtensio |      1.14 |          1391.54 |          1221.81 |         |
| Engine.Scripting.InvokeMethod(InvokeMethodScript: "'String'.GetType()")          |      1.12 |          1388.71 |          1237.80 |         |
| Engine.Scripting.InvokeMethod(InvokeMethodScript: "$fs=New-Object -ComObject scr |      1.03 |         51735.42 |         50022.99 |         |
| Engine.Scripting.InvokeMethod(InvokeMethodScript: "$sh=New-Object -ComObject She |      1.01 |        800938.54 |        791337.34 |         |