; ForEachBenchmarks.Array()
; var sum = 0;
; ^^^^^^^^^^^^
xor eax,eax
; foreach (var item in array!)
; ^^^^^^
mov rdx,[rcx+8]
xor ecx,ecx
This file contains hidden or 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.Threading.Tasks; | |
var root = ParallelAll([ | |
Invert(Repeat(WriteLineRange(0, 4), 2)), | |
WriteLineRange(10, 10), | |
]); | |
await foreach(var _ in root) |
This file contains hidden or 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
/* | |
SharpLab tools in Run mode: | |
• value.Inspect() | |
• Inspect.Heap(object) | |
• Inspect.Stack(value) | |
• Inspect.MemoryGraph(value1, value2, …) | |
*/ | |
using System; | |
using System.Collections.Generic; | |
This file contains hidden or 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.Columns; | |
using BenchmarkDotNet.Configs; | |
using BenchmarkDotNet.Reports; | |
namespace DotNetBenchmarks; | |
class BaseConfig : ManualConfig | |
{ | |
public BaseConfig() | |
{ | |
_ = WithSummaryStyle(SummaryStyle.Default.WithRatioStyle(RatioStyle.Trend)); |
This file contains hidden or 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
// @nuget: System.Numerics.Tensors | |
using System; | |
using System.Linq; | |
using System.Numerics.Tensors; | |
float[] array = [1.0f, float.NaN, 2.0f]; | |
Console.WriteLine($"LINQ Min: {array.Min()}"); | |
Console.WriteLine($"LINQ Max: {array.Max()}"); | |
Console.WriteLine($"Tensors Min: {TensorPrimitives.Min(array)}"); |
This file contains hidden or 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.Columns; | |
using BenchmarkDotNet.Configs; | |
using BenchmarkDotNet.Order; | |
using BenchmarkDotNet.Reports; | |
using NetFabric.Numerics; | |
using System.Runtime.InteropServices; | |
using System.Runtime.CompilerServices; | |
[Config(typeof(Config))] |
This file contains hidden or 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.Numerics; | |
using System.Runtime.CompilerServices; | |
using System.Runtime.InteropServices; | |
using static System.Runtime.InteropServices.JavaScript.JSType; | |
namespace NetFabric; | |
public interface IAction<in T> |
This file contains hidden or 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.Collections.Immutable; | |
using System.Linq; | |
using System.Runtime.InteropServices; | |
using BenchmarkDotNet.Attributes; | |
public class ForEachReferenceBenchmarks | |
{ | |
string[]? array; |
This file contains hidden or 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.Linq; | |
using BenchmarkDotNet.Attributes; | |
using BenchmarkDotNet.Configs; | |
namespace LinqBenchmarks; | |
public record Person(int Age); |
This file contains hidden or 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.Globalization; | |
using System.Text; | |
using System.Text.RegularExpressions; | |
using Nethereum.Signer; | |
using Nethereum.Util; | |
using NodaTime; | |
using NodaTime.Text; | |
namespace Farfetch.Web3; |
NewerOlder