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
<HttpRequestLoggerComponent /> | |
<Router AppAssembly="@typeof(App).Assembly"> | |
<Found Context="routeData"> | |
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" /> | |
<FocusOnNavigate RouteData="@routeData" Selector="h1" /> | |
</Found> | |
<NotFound> |
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.Buffers; | |
using System.Runtime.CompilerServices; | |
using System.Runtime.InteropServices; | |
using System.Runtime.Intrinsics; | |
using System.Runtime.Intrinsics.X86; | |
using System.Text; | |
using BenchmarkDotNet.Attributes; | |
using BenchmarkDotNet.Configs; | |
using BenchmarkDotNet.Jobs; | |
using BenchmarkDotNet.Running; |
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
// Convert full pdb to portable pdb: https://github.com/dotnet/symreader-converter#pdb2pdb | |
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Net.Http; | |
using System.Reflection.Metadata; | |
using System.Text.Json; | |
using System.Text.Json.Serialization; | |
using System.Text.RegularExpressions; |
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 Hashset | |
{ | |
[Benchmark] | |
public void HashSet_Int32() | |
{ | |
var hashset = new HashSet<int>(); | |
for (int i = 0; i < 1000; i++) | |
{ | |
hashset.Add(i); | |
} |
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
// https://www.meziantou.net/how-to-use-csharp-8-indices-and-ranges-in-dotnet-standard-2-0-and-dotn.htm |
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
#pragma warning disable MA0048 // File name must match type name | |
#define INTERNAL_NULLABLE_ATTRIBUTES | |
#if NETSTANDARD2_0 || NETCOREAPP2_0 || NETCOREAPP2_1 || NETCOREAPP2_2 || NET45 || NET451 || NET452 || NET46 || NET461 || NET462 || NET47 || NET471 || NET472 || NET48 | |
// https://github.com/dotnet/corefx/blob/48363ac826ccf66fbe31a5dcb1dc2aab9a7dd768/src/Common/src/CoreLib/System/Diagnostics/CodeAnalysis/NullableAttributes.cs | |
// Licensed to the .NET Foundation under one or more agreements. | |
// The .NET Foundation licenses this file to you under the MIT license. | |
// See the LICENSE file in the project root for more information. |
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
internal static class Program | |
{ | |
private static void Main() | |
{ | |
BenchmarkRunner.Run<Remove>(); | |
} | |
} | |
[CoreJob] | |
[MemoryDiagnoser] |
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
[Benchmark] | |
public string V1() | |
{ | |
return string.Create(13, _id, (buffer, id) => | |
{ | |
var encode32CharsArray = _encode32CharsArray; | |
buffer[0] = encode32CharsArray[(id >> 60) & 31]; | |
buffer[1] = encode32CharsArray[(id >> 55) & 31]; | |
buffer[2] = encode32CharsArray[(id >> 50) & 31]; |
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
.NET Core 2.2.0 (CoreCLR 4.6.27110.04, CoreFX 4.6.27110.04), 64bit RyuJIT | |
BranchmarkString.Benchmark.V6() | |
return string.Create(13, _id, (buffer, id) => | |
^^^ | |
{ | |
^^^ | |
var encode32CharsArray = _encode32CharsArray; | |
^^^ | |
buffer[12] = encode32CharsArray[id & 31]; | |
^^^ |
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 void Main(string[] args) | |
{ | |
var xsl = XDocument.Parse(@"<xsl:stylesheet version=""1.0"" | |
xmlns:xsl=""http://www.w3.org/1999/XSL/Transform"" | |
xmlns:msxsl=""urn:schemas-microsoft-com:xslt"" | |
xmlns:user=""http://dummy/ns""> | |
<msxsl:script language=""C#"" implements-prefix=""user""> | |
<![CDATA[ | |
public string Code() | |
{ |
NewerOlder