From 243d5877a94c2d891bb1734f490a5654fe183295 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 22 Jan 2026 16:27:34 +0000 Subject: [PATCH 1/2] Initial plan From 81bfdf261be4b36141bd7fb4bcfd1a08df6e52a5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 22 Jan 2026 16:31:59 +0000 Subject: [PATCH 2/2] Apply changes from PR #397: update C# infrastructure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add clang dependency to .github/dotnet.sh for NativeAOT support - Add csharp_preview and csharp_native_aot to bench.yml workflow - Add unzip requirement to README.md - Add multiproc regex-redux files (5-m.cs, 6-m.cs) to bench configs - Fix lang field in bench_csharp_native_aot.yaml - Enable and uncomment scenarios in bench_csharp_preview.yaml - Fix ProcFs naming convention (procfs → ProcFs) for consistency Co-authored-by: danmoseley <6385855+danmoseley@users.noreply.github.com> --- .github/dotnet.sh | 2 +- .github/workflows/bench.yml | 2 + README.md | 2 + bench/bench_csharp.yaml | 2 + bench/bench_csharp_native_aot.yaml | 4 +- bench/bench_csharp_preview.yaml | 120 +++++++++--------- .../Interop.ProcFsStat.TryReadStatusFile.cs | 2 +- bench/tool/Linux/procfs/Interop.ProcFsStat.cs | 2 +- bench/tool/ProcessUtils.cs | 8 +- 9 files changed, 78 insertions(+), 66 deletions(-) diff --git a/.github/dotnet.sh b/.github/dotnet.sh index 086a0e1fd..1d4a6e191 100755 --- a/.github/dotnet.sh +++ b/.github/dotnet.sh @@ -3,4 +3,4 @@ curl -sSL https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc sudo apt-add-repository https://packages.microsoft.com/ubuntu/22.04/prod sudo apt-get update -sudo apt-get install -y libmsquic zlib1g-dev +sudo apt-get install -y libmsquic zlib1g-dev clang diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index f20378144..0be3be554 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -30,6 +30,8 @@ jobs: codon, cpp, csharp, + csharp_preview, + csharp_native_aot, crystal, d, dart, diff --git a/README.md b/README.md index 88a224513..dd83a0fa9 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,8 @@ _Current benchmarks problems and their implementations are from [The Computer La [podman](https://podman.io/getting-started/installation) (or [docker](https://www.docker.com/) by changing `docker_cmd: podman` to `docker_cmd: docker` in `bench/bench.yaml`) +unzip + ## Build _The 1st step is to build source code from various of languages_ diff --git a/bench/bench_csharp.yaml b/bench/bench_csharp.yaml index 20b278e9a..31ac6a19a 100644 --- a/bench/bench_csharp.yaml +++ b/bench/bench_csharp.yaml @@ -35,7 +35,9 @@ problems: - name: regex-redux source: - 5.cs + - 5-m.cs - 6.cs + - 6-m.cs - name: mandelbrot source: - 1.cs diff --git a/bench/bench_csharp_native_aot.yaml b/bench/bench_csharp_native_aot.yaml index f434fbfa4..c2327a1c9 100644 --- a/bench/bench_csharp_native_aot.yaml +++ b/bench/bench_csharp_native_aot.yaml @@ -1,4 +1,4 @@ -lang: csharp +lang: csharp_native_aot problems: - name: helloworld source: @@ -34,7 +34,9 @@ problems: - name: regex-redux source: - 5.cs + - 5-m.cs - 6.cs + - 6-m.cs - name: mandelbrot source: - 1.cs diff --git a/bench/bench_csharp_preview.yaml b/bench/bench_csharp_preview.yaml index b3bc54b18..ab82c3fff 100644 --- a/bench/bench_csharp_preview.yaml +++ b/bench/bench_csharp_preview.yaml @@ -1,68 +1,72 @@ -lang: csharp -enabled: false +lang: csharp_preview problems: - # - name: helloworld - # source: - # - 1.cs - # - name: binarytrees - # source: - # - 1.cs - # - name: merkletrees - # source: - # - 1.cs - # - 2.cs - # - name: nbody - # source: - # - 8.cs - # - 9.cs - # - name: spectral-norm - # source: - # - 3.cs - # - name: pidigits - # source: - # - 1.cs - # - name: edigits - # source: - # - 1.cs - # - name: fannkuch-redux - # source: - # # - 9.cs - # - name: fasta - # source: - # - 5.cs - # - name: knucleotide - # source: - # - 6.cs + - name: helloworld + source: + - 1.cs + - name: binarytrees + source: + - 1.cs + - name: merkletrees + source: + - 1.cs + - 2.cs + - name: nbody + source: + - 8.cs + - 9.cs + - name: spectral-norm + source: + - 3.cs + - name: pidigits + source: + - 1.cs + - name: edigits + source: + - 1.cs + - name: fannkuch-redux + source: + # - 9.cs + - name: fasta + source: + - 5.cs + - name: knucleotide + source: + - 6.cs - name: regex-redux source: - 5.cs - # - 5p.cs - # - name: mandelbrot - # source: - # - 1.cs - # - 2.cs - # - 3.cs - # - name: json-serde - # source: - # - 1.cs - # - 2.cs - # - name: coro-prime-sieve - # source: - # - 1.cs + - 5-m.cs + - 6.cs + - 6-m.cs + - name: mandelbrot + source: + - 1.cs + - 2.cs + - 3.cs + - name: json-serde + source: + - 1.cs + - 2.cs + - name: coro-prime-sieve + source: + - 1.cs - name: http-server source: + - 1.cs + - 2.cs + - 2-http2.cs - 2-http3.cs - # - name: nsieve - # source: - # - 1.cs - # - 2.cs - # - name: lru - # source: - # - 1.cs - # - 2.cs - # - name: secp256k1 - # source: - # - 1.cs + - name: nsieve + source: + - 1.cs + - 2.cs + - name: lru + source: + - 1.cs + - 2.cs + - name: secp256k1 + source: + - 1.cs compiler_version_command: compiler_version_regex: runtime_version_parameter: diff --git a/bench/tool/Linux/procfs/Interop.ProcFsStat.TryReadStatusFile.cs b/bench/tool/Linux/procfs/Interop.ProcFsStat.TryReadStatusFile.cs index 31665444b..566bcac13 100644 --- a/bench/tool/Linux/procfs/Interop.ProcFsStat.TryReadStatusFile.cs +++ b/bench/tool/Linux/procfs/Interop.ProcFsStat.TryReadStatusFile.cs @@ -14,7 +14,7 @@ internal static partial class Interop { - internal static partial class procfs + internal static partial class ProcFs { internal const string RootPath = "/proc/"; private const string StatusFileName = "/status"; diff --git a/bench/tool/Linux/procfs/Interop.ProcFsStat.cs b/bench/tool/Linux/procfs/Interop.ProcFsStat.cs index efa96a3e0..a5b2d06ea 100644 --- a/bench/tool/Linux/procfs/Interop.ProcFsStat.cs +++ b/bench/tool/Linux/procfs/Interop.ProcFsStat.cs @@ -13,7 +13,7 @@ internal static partial class Interop { - internal static partial class procfs + internal static partial class ProcFs { private const string ExeFileName = "/exe"; private const string CmdLineFileName = "/cmdline"; diff --git a/bench/tool/ProcessUtils.cs b/bench/tool/ProcessUtils.cs index ab3371257..be4216032 100644 --- a/bench/tool/ProcessUtils.cs +++ b/bench/tool/ProcessUtils.cs @@ -215,12 +215,12 @@ public static async Task MeasureAsync( long totalMemoryBytes = 0; if (s_isLinux) { - if (procfs.TryReadStatFile(pid, out procfs.ParsedStat stat)) + if (ProcFs.TryReadStatFile(pid, out ProcFs.ParsedStat stat)) { m.CpuTimeUser = TicksToTimeSpanLinux(stat.utime + stat.cutime); m.CpuTimeKernel = TicksToTimeSpanLinux(stat.stime + stat.cstime); isChildProcessCpuTimeCounted = stat.cutime > 0 || stat.cstime > 0; - if (procfs.TryReadStatusFile(pid, out procfs.ParsedStatus status)) + if (ProcFs.TryReadStatusFile(pid, out ProcFs.ParsedStatus status)) { totalMemoryBytes = (long)status.VmRSS; } @@ -276,14 +276,14 @@ public static async Task MeasureAsync( m.CpuTimeKernel += cp.PrivilegedProcessorTime; totalMemoryBytes += cp.WorkingSet64; } - else if (procfs.TryReadStatFile(cp.Id, out procfs.ParsedStat cpstat)) + else if (ProcFs.TryReadStatFile(cp.Id, out ProcFs.ParsedStat cpstat)) { if (!isChildProcessCpuTimeCounted) { m.CpuTimeUser += TicksToTimeSpanLinux(cpstat.utime); m.CpuTimeKernel += TicksToTimeSpanLinux(cpstat.stime); } - if (procfs.TryReadStatusFile(cp.Id, out procfs.ParsedStatus cpstatus)) + if (ProcFs.TryReadStatusFile(cp.Id, out ProcFs.ParsedStatus cpstatus)) { totalMemoryBytes += (long)cpstatus.VmRSS; }