This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using BenchmarkDotNet.Attributes; | |
using BenchmarkDotNet.Attributes.Jobs; | |
using BenchmarkDotNet.Running; | |
using System.Collections.Generic; | |
using System.Runtime.CompilerServices; | |
namespace Dict | |
{ | |
[InProcess] | |
public class Program |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class OwnedMemorySegment<T> : ReadOnlySequenceSegment<T> | |
{ | |
private OwnedMemory<T> _ownedMemory; | |
public OwnedMemorySegment(OwnedMemory<T> memory) | |
{ | |
_ownedMemory = memory; | |
Memory = memory.Memory; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
namespace SimRing { | |
class Program { | |
static void Main(string[] args) { | |
const int n = 1000; | |
const int m = 1000; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Buffers; | |
using System.Buffers.Binary; | |
using System.Collections; | |
using System.IO.Pipelines; | |
using System.Threading; | |
using System.Threading.Tasks; | |
class Program | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IAwaitable<out TResult> : ICriticalNotifyCompletion | |
{ | |
bool IsCompleted { get; } | |
TResult GetResult(); | |
} | |
public static class AwaitableExtensions | |
{ | |
public static IAwaitable<TResult> GetAwaiter<TResult>(this IAwaitable<TResult> source) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Threading; | |
using BenchmarkDotNet.Attributes; | |
using BenchmarkDotNet.Configs; | |
using BenchmarkDotNet.Jobs; | |
using BenchmarkDotNet.Running; | |
namespace ExecutionContextTest | |
{ | |
[Config(typeof(InProcConfig))] | |
public class Program |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using BenchmarkDotNet.Attributes; | |
using BenchmarkDotNet.Attributes.Jobs; | |
using BenchmarkDotNet.Running; | |
namespace DictionaryPerf | |
{ | |
[InProcess] | |
public class Program | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Globalization; | |
using System.Numerics; | |
using System.Runtime.CompilerServices; | |
namespace UnsafeTesting | |
{ | |
public class Program | |
{ | |
static void Main(string[] args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Globalization; | |
using System.Numerics; | |
using System.Runtime.CompilerServices; | |
namespace UnsafeTesting | |
{ | |
public class Program | |
{ | |
static void Main(string[] args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Program | |
{ | |
public static void Main(string[] args) | |
{ | |
var list = new List<int>(); | |
// *** Have to double specify types *** :( | |
PrintValues<List<int>, int>(list); | |
} | |
public static void PrintValues<TEnumerable, T>(TEnumerable enumerable) |