diff --git a/scripts/bench-read-bulk.ps1 b/scripts/bench-read-bulk.ps1 index 7aa9cdc..0a4568c 100644 --- a/scripts/bench-read-bulk.ps1 +++ b/scripts/bench-read-bulk.ps1 @@ -126,8 +126,13 @@ function Get-ClientCommand { switch ($Client) { "dotnet" { + # -c Release matches the rest of the matrix: HotSpot/Tier 1 JIT + # closes most of the debug/release gap for .NET on its own, but + # Release also disables JIT inline thresholds that hurt Stopwatch- + # bracketed measurement noise. Same project must have been built + # in Release at least once before this --no-build invocation. $cliArgs = @( - "run", "--project", "clients/dotnet/MxGateway.Client.Cli", "--no-build", "--", + "run", "--project", "clients/dotnet/MxGateway.Client.Cli", "-c", "Release", "--no-build", "--", "bench-read-bulk", "--endpoint", $httpEndpoint, "--api-key-env", $ApiKeyEnv, @@ -163,8 +168,13 @@ function Get-ClientCommand { return [pscustomobject]@{ file = "go"; args = $cliArgs; cwd = (Join-Path $repoRoot "clients/go") } } "rust" { + # --release is essential: Rust debug builds disable inlining and + # add overflow checks, which costs the bench ~45% of throughput + # and ~3x of p99 latency vs release. The other compiled clients + # don't have this gap (go run is optimized, dotnet/java run JIT- + # optimized after the warmup window). $cliArgs = @( - "run", "--quiet", "-p", "mxgw-cli", "--", + "run", "--release", "--quiet", "-p", "mxgw-cli", "--", "bench-read-bulk", "--endpoint", $httpEndpoint, "--api-key-env", $ApiKeyEnv,