Skip to content

Instantly share code, notes, and snippets.

🦆
rubber duck debugging

Ben Adams benaadams

🦆
rubber duck debugging
Block or report user

Report or block benaadams

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View DelegateVsInterface
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
using System;
namespace delegate_interface
{
public class Program : IFoo
{
const int InnerLoopCount = 10000;
View IBufferWriter.cs
using System;
using System.Buffers;
using System.Runtime.CompilerServices;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
public class Program
{
public static void Main(string[] args)
=> BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args);
@benaadams
benaadams / Enviorment
Last active Dec 9, 2018
PipeThroughputBenchmark
View Enviorment
SET COMPlus_TieredCompilation=0
View NRHashCode.cs
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
using System;
namespace hash
{
public class Program
{
const int Iterations = 10;
View <Task1>d__1:MoveNext()_JitDump.txt
This file has been truncated, but you can view the full file.
****** START compiling <Task1>d__1:MoveNext():this (MethodHash=39840edc)
Generating code for Windows x64
OPTIONS: compCodeOpt = BLENDED_CODE
OPTIONS: compDbgCode = false
OPTIONS: compDbgInfo = true
OPTIONS: compDbgEnC = false
OPTIONS: compProcedureSplitting = false
OPTIONS: compProcedureSplittingEH = false
OPTIONS: Stack probing is DISABLED
View asyncValueTask_JitDump.txt
This file has been truncated, but you can view the full file.
****** START compiling <ValueTask1>d__1:MoveNext():this (MethodHash=87def557)
Generating code for Windows x64
OPTIONS: compCodeOpt = BLENDED_CODE
OPTIONS: compDbgCode = false
OPTIONS: compDbgInfo = true
OPTIONS: compDbgEnC = false
OPTIONS: compProcedureSplitting = false
OPTIONS: compProcedureSplittingEH = false
OPTIONS: Stack probing is DISABLED
View ViaStruct5_JitDump.txt
****** START compiling Program:ViaStruct5() (MethodHash=900a8869)
Generating code for Windows x64
OPTIONS: compCodeOpt = BLENDED_CODE
OPTIONS: compDbgCode = false
OPTIONS: compDbgInfo = true
OPTIONS: compDbgEnC = false
OPTIONS: compProcedureSplitting = false
OPTIONS: compProcedureSplittingEH = false
OPTIONS: Stack probing is DISABLED
IL to import:
View ValueLinqBenchmarks.cs
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Attributes.Columns;
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Running;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
View DoubleBufferedStreamReader.Read.cs
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int ReadByte()
{
if (this.position >= this.Length)
{
return -1;
}
if (this.position == 0 || this.bytesRead >= ChunkLength)
{
View nagle.cs
const int maxBuffer = 1024;
while (true)
{
var result = await application.Output.ReadAsync();
var buffer = result.Buffer;
// Check if we have enough to perform a write
if (buffer.Length >= maxBuffer)
{
You can’t perform that action at this time.