From a8a87662746d0be8cd7ec9e80ebbaa5e6187f885 Mon Sep 17 00:00:00 2001 From: Dom Slee Date: Wed, 10 Jun 2026 20:29:00 +1000 Subject: [PATCH] Benchmark NativeAOT alongside CoreCLR; add perf table to README Revives the parked NativeAot benchmark job now that BenchmarkDotNet 0.15.8 supports .NET 10. Steady-state delete throughput is identical between runtimes (ratio 1.01-1.07); AOT wins on startup, shown in the hyperfine table added to the README. Co-Authored-By: Claude Fable 5 --- .../src/FileAndDirectoryDeleterBenchmark.cs | 5 +++-- README.md | 11 +++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ForceOps.Benchmarks/src/FileAndDirectoryDeleterBenchmark.cs b/ForceOps.Benchmarks/src/FileAndDirectoryDeleterBenchmark.cs index 32c8538..bbf190b 100644 --- a/ForceOps.Benchmarks/src/FileAndDirectoryDeleterBenchmark.cs +++ b/ForceOps.Benchmarks/src/FileAndDirectoryDeleterBenchmark.cs @@ -1,10 +1,11 @@ using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; using ForceOps.Lib; namespace ForceOps.Benchmarks; -// [SimpleJob(RuntimeMoniker.NativeAot80)] -[SimpleJob] +[SimpleJob(RuntimeMoniker.Net10_0, baseline: true)] +[SimpleJob(RuntimeMoniker.NativeAot10_0)] public class FileAndDirectoryDeleterBenchmark { readonly List fileDatas = new(); diff --git a/README.md b/README.md index e8c8cb9..3924f1c 100644 --- a/README.md +++ b/README.md @@ -94,6 +94,17 @@ RelaunchHelpers.RunWithRelaunchAsElevated(() => }, () => args.ToList(), forceOpsContext); ``` +## Performance + +Native AOT vs framework-dependent, measured with [hyperfine](https://github.com/sharkdp/hyperfine): + +| Scenario | Native AOT | Framework-dependent | Speedup | +| --- | --- | --- | --- | +| `forceops --help` (startup) | 9.8 ms ± 1.1 ms | 107.9 ms ± 6.9 ms | 11x | +| `forceops rm` (directory with 1,000 files) | 151.4 ms ± 11.1 ms | 219.1 ms ± 15.8 ms | 1.45x | + +The scoop and GitHub release installs are Native AOT. `dotnet tool install` is framework-dependent. + ## Context See [Benchmarks](https://domsleee.github.io/ForceOps/) on github pages.