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.Text; | |
namespace Sylvan.IO; | |
sealed class IndentingTextWriter : TextWriter | |
{ | |
const char OpenChar = '{'; | |
const char CloseChar = '}'; | |
const string DefaultIndent = " "; |
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.Analysers; | |
using BenchmarkDotNet.Columns; | |
using BenchmarkDotNet.Configs; | |
using BenchmarkDotNet.Diagnosers; | |
using BenchmarkDotNet.Engines; | |
using BenchmarkDotNet.Exporters; | |
using BenchmarkDotNet.Loggers; | |
using BenchmarkDotNet.Reports; | |
using BenchmarkDotNet.Running; | |
using BenchmarkDotNet.Validators; |
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 System; | |
using System.Runtime.Intrinsics; | |
using System.Runtime.Intrinsics.X86; | |
using System.Text; | |
namespace Benchmarks | |
{ | |
public class QuickIntBench | |
{ |
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
static class Program | |
{ | |
public static void Main() | |
{ | |
int[] data = new int[12]; | |
// foreach over refs to the elements of the array | |
foreach(ref int elem in data.Refs()) | |
{ | |
elem = 1; |
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; | |
namespace Sylvan | |
{ | |
public sealed class IgnoreWhitespaceStringComparer : IEqualityComparer<string> | |
{ | |
public static readonly IEqualityComparer<string> Instance = new IgnoreWhitespaceStringComparer(0); | |
public static readonly IEqualityComparer<string> IgnoreCase = new IgnoreWhitespaceStringComparer(0x20); |
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.Data.SqlClient; | |
using System.Runtime.InteropServices; | |
class Program | |
{ | |
static void Main() | |
{ | |
var dbName = "Test" + DateTime.Now.ToString("yyyyMMddHHmmss"); |
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; | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
int total = 0; | |
int count = 0; | |
while (true) { | |
count++; | |
var start = DateTime.UtcNow; |
NewerOlder