EgorBot / runtime-utils

MIT License
0 stars 1 forks source link

EgorBot for EgorBo in #109570 #151

Open EgorBot opened 1 week ago

EgorBot commented 1 week ago

Processing https://github.com/dotnet/runtime/pull/109570#issuecomment-2466272210 command:

Command -aws_cached_genoa ```cs using System.Runtime.InteropServices; using BenchmarkDotNet.Attributes; using System.Runtime.CompilerServices; using BenchmarkDotNet.Running; BenchmarkSwitcher.FromAssembly(typeof(Bench).Assembly).Run(args); public unsafe class Bench { static byte* _srcAlign64; static byte* _srcAlign8; [GlobalSetup] public void Setup() { _srcAlign64 = (byte*)NativeMemory.AlignedAlloc(1024 * 1024, 64); _srcAlign8 = _srcAlign64 + 8; } [GlobalCleanup] public void Cleanup() => NativeMemory.AlignedFree(_srcAlign64); [Benchmark] public void Zero256_Align64() => Unsafe.InitBlockUnaligned(_srcAlign64, 0, 256); } ```

(EgorBot will reply in this issue)

EgorBot commented 1 week ago

Benchmark results on linux-cachedgenoa

BenchmarkDotNet v0.14.0, Ubuntu 24.04.1 LTS (Noble Numbat)
AMD EPYC 9R14, 1 CPU, 16 logical and 16 physical cores
  Job-XEVTSC : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
  Job-EIWMHX : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
Method Toolchain Mean Error Ratio
Zero256_Align64 Main 1.040 ns 0.0006 ns 1.00
Zero256_Align64 PR 8.401 ns 0.0008 ns 8.08

BDN_Artifacts.zip

EgorBot commented 1 week ago

cc @EgorBo (logs)

EgorBo commented 4 days ago

@EgorBot -codesafety -pr 109896

EgorBot commented 4 days ago

Code safety report for PR 109896

Folder Total
methods
P/Invokes Methods with
'unsafe' context
Methods with
Unsafe API calls
System.Text.Encodings.Web 🟩 137 (${\textsf{\color{green}-10}}$) 0 18 🟩 6 (${\textsf{\color{green}-7}}$)
All 🟩 131302 (${\textsf{\color{green}-10}}$) 2650 6020 🟩 2578 (${\textsf{\color{green}-7}}$)

Full report: link UnsafeCodeAnalyzer's source: link

cc @EgorBo