Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/dotnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ jobs:
codon,
cpp,
csharp,
csharp_preview,
csharp_native_aot,
crystal,
d,
dart,
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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_
Expand Down
2 changes: 2 additions & 0 deletions bench/bench_csharp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ problems:
- name: regex-redux
source:
- 5.cs
- 5-m.cs
- 6.cs
- 6-m.cs
- name: mandelbrot
source:
- 1.cs
Expand Down
4 changes: 3 additions & 1 deletion bench/bench_csharp_native_aot.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
lang: csharp
lang: csharp_native_aot
problems:
- name: helloworld
source:
Expand Down Expand Up @@ -34,7 +34,9 @@ problems:
- name: regex-redux
source:
- 5.cs
- 5-m.cs
- 6.cs
- 6-m.cs
- name: mandelbrot
source:
- 1.cs
Expand Down
120 changes: 62 additions & 58 deletions bench/bench_csharp_preview.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
2 changes: 1 addition & 1 deletion bench/tool/Linux/procfs/Interop.ProcFsStat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
8 changes: 4 additions & 4 deletions bench/tool/ProcessUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -215,12 +215,12 @@ public static async Task<ProcessMeasurement> 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;
}
Expand Down Expand Up @@ -276,14 +276,14 @@ public static async Task<ProcessMeasurement> 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;
}
Expand Down