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 / Win-Default-Egor--vs--Default-Main.txt
Last active June 10, 2021 09:54
Win-Default-Egor--vs--Default-Main.txt
summary:
better: 293, geomean: 1.168
worse: 6, geomean: 1.097
total diff: 299
| Slower | diff/base | Base Median (ns) | Diff Median (ns) | Modality|
| -------------------------------------------------------------------------------- | ---------:| ----------------:| ----------------:| --------:|
| System.Text.Json.Document.Tests.Perf_EnumerateArray.Parse(TestCase: ArrayOfNumbe | 1.28 | 15196.92 | 19394.85 | |
| System.Text.Json.Reader.Tests.Perf_Base64.ReadBase64EncodedByteArray_NoEscaping( | 1.12 | 98.76 | 111.06 | |
| System.Text.Json.Tests.Perf_Get.GetGuid | 1.06 | 6085.42 | 6442.95 | |
@EgorBo
EgorBo / Win-DynPGO-Egor--vs--DynPGO-Main.txt
Last active June 2, 2021 07:00
Win-DynPGO-Egor--vs--DynPGO-Main.txt
C:\prj\performance\src\tools\ResultsComparer>dotnet run --base C:\prj\arts\main-opt-JSON1\results --diff C:\prj\arts\egor-opt-JSON1\results --threshold 4%
summary:
better: 317, geomean: 1.214
worse: 2, geomean: 1.091
total diff: 319
| Slower | diff/base | Base Median (ns) | Diff Median (ns) | Modality|
| -------------------------------------------------------------------------------- | ---------:| ----------------:| ----------------:| --------:|
| System.Text.Json.Reader.Tests.Perf_Base64.ReadBase64EncodedByteArray_NoEscaping( | 1.13 | 92.29 | 104.63 | |
| System.Text.Json.Serialization.Tests.ReadJson<BinaryData>.DeserializeFromStream | 1.05 | 839.65 | 880.73 | |
@EgorBo
EgorBo / Win-DynPGO-Egor--vs--Default-Main.txt
Last active June 2, 2021 07:03
Win-DynPGO-Egor--vs--Default-Main.txt
summary:
better: 331, geomean: 1.334
worse: 1, geomean: 1.079
total diff: 332
| Slower | diff/base | Base Median (ns) | Diff Median (ns) | Modality|
| -------------------------------------------------------------------------------- | ---------:| ----------------:| ----------------:| --------:|
| System.Text.Json.Reader.Tests.Perf_Base64.ReadBase64EncodedByteArray_NoEscaping( | 1.08 | 96.93 | 104.63 | |
| Faster | base/diff | Base Median (ns) | Diff Median (ns) | Modality|
@EgorBo
EgorBo / JSON.txt
Created May 23, 2021 12:07
JSON.txt
better: 208, geomean: 1.124
worse: 15, geomean: 1.067
total diff: 223
| Slower | diff/base | Base Median (ns) | Diff Median (ns) | Modality|
| -------------------------------------------------------------------------------- | ---------:| ----------------:| ----------------:| --------:|
| System.Text.Json.Tests.Utf8JsonReaderCommentsTests.Utf8JsonReaderCommentParsing( | 1.34 | 6295.70 | 8407.93 | |
| System.Text.Json.Reader.Tests.Perf_Base64.ReadBase64EncodedByteArray_NoEscaping( | 1.19 | 92.78 | 110.15 | |
| System.Text.Json.Tests.Perf_Reader.ReadReturnBytes(IsDataCompact: True, TestCase | 1.08 | 8754.53 | 9414.43 | |
| System.Text.Json.Tests.Perf_Reader.ReadSingleSpanSequenceEmptyLoop(IsDataCompact | 1.06 | 2173.88 | 2308.44 | |
@EgorBo
EgorBo / nullchecks.txt
Created May 12, 2021 15:02
nullchecks.txt
PS C:\prj\runtime> ^C
PS C:\prj\runtime> python .\src\coreclr\scripts\superpmi.py asmdiffs
Warning: deleting existing log file C:\prj\runtime\artifacts\spmi\superpmi.log
================ Logging to C:\prj\runtime\artifacts\spmi\superpmi.log
Using JIT/EE Version from jiteeversionguid.h: 12234eca-dfc2-48bc-a320-6155cf25ce17
Baseline hash: 99740f1f531320f77401bb6e70aad0d89f70b6fb
Using baseline C:\prj\runtime\artifacts\spmi\basejit\deaaf6913922c936978e259e48e59a6eb6ac71a4.windows.x64.Checked\clrjit.dll
Using coredistools found at C:\prj\runtime\artifacts\tests\coreclr\windows.x64.Checked\Tests\Core_Root\coredistools.dll
Found download cache directory "C:\prj\runtime\artifacts\spmi\mch\12234eca-dfc2-48bc-a320-6155cf25ce17.windows.x64" and --force_download not set; skipping download
SuperPMI ASM diffs
using System;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
public class Program
{
[MethodImpl(MethodImplOptions.NoInlining)]
public static void Main()
{
@EgorBo
EgorBo / run.cmd
Last active May 7, 2021 19:45
run.cmd
build.cmd Clr+Libs -c Release
build.cmd Clr -c Checked
cd src\tests
build.cmd Release generatelayoutonly
cd ..\..
jit-diff diff --output C:\prj\jit-diffs --corelib --core_root C:\prj\runtime\artifacts\tests\coreclr\windows.x64.Release\Tests\Core_Root --base C:\prj\runtime\artifacts\bin\coreclr\windows.x64.Checked --pmi
# Now apply your change to corelib
# rebuild it:
@EgorBo
EgorBo / Analyze.cs
Created May 4, 2021 20:41
Analyze.cs
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection.Metadata;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Text;
public static class Program
@EgorBo
EgorBo / tailcall-assert-dump.txt
Created April 6, 2021 20:22
tailcall-assert-dump.txt
****** START compiling ICSharpCode.Decompiler.TypeSystem.ArrayType:AcceptVisitor(ICSharpCode.Decompiler.TypeSystem.TypeVisitor):ICSharpCode.Decompiler.TypeSystem.IType:this (MethodHash=0ac853de)
Generating code for Windows x64
OPTIONS: Tier-1 compilation
OPTIONS: compCodeOpt = FAST_CODE
OPTIONS: compDbgCode = false
OPTIONS: compDbgInfo = true
OPTIONS: compDbgEnC = false
OPTIONS: compProcedureSplitting = false
OPTIONS: compProcedureSplittingEH = false
OPTIONS: optimized using profile data
@EgorBo
EgorBo / call-beep.cs
Created March 25, 2021 08:51
call-beep.cs
using System;
using System.Runtime.InteropServices;
class Prog
{
static unsafe void Main()
{
var func = (delegate* unmanaged<int, int, int>)GetProcAddress(GetModuleHandle("kernel32.dll"), "Beep");
int result = func(500, 500);
}