Skip to content

Instantly share code, notes, and snippets.

@ljw1004
ljw1004 / tuple_perf.cs
Created April 20, 2017 15:02
Perf comparison ValueTuple vs Tuple vs KeyValuePair
// TUPLE MICRO-BENCHMARKS, based on https://www.dotnetperls.com/tuple-keyvaluepair
//
// Tuples are generally fastest.
// ValueTuple is fastest in the particular case of GetHashCode.
// KeyValuePair is always worst.
//
//
// RAW RESULTS
// Numbers in milliseconds (lower is better)
//
@ljw1004
ljw1004 / ValueTask_GetNextByteAsync.cs
Created July 21, 2016 17:53
Simple example of async ValueTask
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
class Program
{
static void Main()
{