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.Running; | |
static class Program | |
{ | |
static void Main(string[] args) | |
{ | |
BenchmarkSwitcher.FromAssembly(typeof(MainBenchmarks).Assembly).Run(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
| Method | Job | Toolchain | Mean | Error | StdDev | Ratio | | |
|------------ |----------- |----------------------------:|----------:|----------:|----------:|------:| | |
| IndexOf | Job-OHKTCB | \Core_Root_Base\corerun.exe | 33.219 ns | 0.0815 ns | 0.0636 ns | 1.00 | | |
| IndexOf | Job-QKMCMY | \Core_Root_EGOR\corerun.exe | 16.176 ns | 0.0254 ns | 0.0238 ns | 0.49 | | |
| | | | | | | | | |
| LastIndexOf | Job-OHKTCB | \Core_Root_Base\corerun.exe | 31.953 ns | 0.0232 ns | 0.0217 ns | 1.00 | | |
| LastIndexOf | Job-QKMCMY | \Core_Root_EGOR\corerun.exe | 15.704 ns | 0.0374 ns | 0.0312 ns | 0.49 | | |
| | | | | | | | | |
| Contains | Job-OHKTCB | \Core_Root_Base\corerun.exe | 27.097 ns | 0.0301 ns | 0.0235 ns | 1.00 | |
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
Job-PEQKNF : .NET 7.0.0 (42.42.42.42424), X64 RyuJIT | |
WarmupCount=30 | |
| Method | Toolchain | source | str | Mean | Error | StdDev | Median | Ratio | | |
|------------ |-----------------------------|--------------------- |----------------- |-----------:|----------:|----------:|-----------:|------:| | |
| IndexOf | \Core_Root_Base\corerun.exe | <html(...)html> [60] | </hhhh> | 50.478 ns | 0.0415 ns | 0.0368 ns | 50.474 ns | 1.00 | | |
| IndexOf | \Core_Root_EGOR\corerun.exe | <html(...)html> [60] | </hhhh> | 15.091 ns | 0.0092 ns | 0.0081 ns | 15.090 ns | 0.30 | 👍 | |
| | | | | | | | | | | |
| LastIndexOf | \Core_Root_Base\corerun.exe | <html(...)html> [60] | </hhhh> | 43.979 ns | 0.0783 ns | 0.0732 ns | 43.970 ns | 1.00 | |
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.Diagnostics; | |
using System.Numerics; | |
using System.Runtime.CompilerServices; | |
using System.Runtime.InteropServices; | |
using System.Runtime.Intrinsics; | |
using System.Runtime.Intrinsics.X86; | |
using System.Text; | |
public class Prog |
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.Runtime.CompilerServices; | |
using System.Runtime.InteropServices; | |
using System.Runtime.Intrinsics; | |
using System.Runtime.Intrinsics.X86; | |
using BenchmarkDotNet.Attributes; | |
//| Method | headerName | Mean | Error | StdDev | Ratio | | |
//|----------------- |------------------- |---------:|----------:|----------:|------:| |
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.Diagnostics; | |
using System.Numerics; | |
using System.Runtime.CompilerServices; | |
using System.Runtime.Intrinsics; | |
using System.Runtime.Intrinsics.Arm; | |
using System.Runtime.Intrinsics.X86; | |
using System.Text; | |
using BenchmarkDotNet.Attributes; |
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.Runtime.CompilerServices; | |
using System.Runtime.InteropServices; | |
using System.Runtime.Intrinsics; | |
using System.Runtime.Intrinsics.X86; | |
using BenchmarkDotNet.Attributes; | |
//BenchmarkDotNet=v0.13.1, OS=Windows 10.0.19042.1415 (20H2/October2020Update) | |
//Intel Core i7-8700K CPU 3.70GHz (Coffee Lake), 1 CPU, 12 logical and 6 physical cores |
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.IO; | |
static class Program | |
{ | |
static void WL(string str) => File.AppendAllText(@"C:\prj\t.cs", str + Environment.NewLine); | |
static void Main() | |
{ | |
string[] values = |
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.Runtime.CompilerServices; | |
using System.Runtime.InteropServices; | |
public class Program | |
{ | |
static ref byte GetRawData(object obj) => | |
ref Unsafe.As<RawData>(obj).Data; | |
[StructLayout(LayoutKind.Sequential)] |
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.Diagnostics; | |
using System.Runtime.CompilerServices; | |
using System.Threading; | |
public interface IInterface1 { IInterface2 GetInterface(); } | |
public interface IInterface2 { IInterface3 GetInterface(); } | |
public interface IInterface3 { IInterface4 GetInterface(); } | |
public interface IInterface4 { void SayHello(); } |