daily update on 20241129 by nitload youmu, frameworkDialogue added

This commit is contained in:
Nitload
2024-11-29 05:47:53 +08:00
parent 6e2f93b053
commit 7c8d462ca5
2190 changed files with 49578 additions and 72052 deletions
+42
View File
@@ -0,0 +1,42 @@
using BenchmarkDotNet.Running;
using BenchmarkDotNet.Attributes;
using System.Runtime.InteropServices;
using System.Reflection;
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BenchmarkDotNet.Jobs;
using Microsoft.Diagnostics.Tracing.Parsers.Clr;
namespace BenchMark
{
public static class Program
{
static void Main(string[] args)
{
var summary = BenchmarkRunner.Run<BenchmarkClass>();
}
}
[SimpleJob(launchCount: 2, warmupCount: 2, iterationCount: 2)]
public unsafe class BenchmarkClass
{
[Benchmark]
public void HandleCalc()
{
int[] array = new int[4];
IntPtr ptr = GCHandle.Alloc(array).AddrOfPinnedObject();
}
[Benchmark]
public void MemCalc()
{
int[] array = new int[4];
Memory<int> memory = new Memory<int>(array);
void* ptr = memory.Pin().Pointer;
}
}
}