Skip to content

Conversation

@eric-wang-1990
Copy link
Collaborator

@eric-wang-1990 eric-wang-1990 commented Dec 2, 2025

Summary

Switch both benchmark jobs to use a self-hosted Windows runner and serialize execution to ensure consistent performance measurements without network contention.

Changes

Runner Configuration

  • .NET 8.0 job: ubuntu-latest[self-hosted, Windows, benchmark-runner]
  • .NET Framework 4.7.2 job: windows-2022[self-hosted, Windows, benchmark-runner]

Execution Serialization

  • Concurrency group: Single queue for all benchmark runs (no parallel workflows)
  • Job dependency: .NET Framework 4.7.2 waits for .NET 8.0 to complete
  • Cancel-in-progress: Disabled (runs queue instead of being canceled)

Benefits

Consistent hardware specs - Same CPU, RAM, and disk for all benchmark runs
No network contention - Only one benchmark downloads data at a time
Predictable network performance - Full bandwidth available to each benchmark
Accurate measurements - No degradation from parallel execution
Better baseline comparisons - Apples-to-apples performance comparisons
Single runner - Only need one Windows self-hosted runner for both jobs

How It Works

Workflow-level serialization:

  • Multiple workflow runs (different commits/PRs) queue and run one at a time
  • New runs wait for current run to complete instead of canceling it

Job-level serialization:

  • .NET 8.0 job runs first
  • .NET Framework 4.7.2 job waits for .NET 8.0 to complete
  • No parallel downloads competing for bandwidth

Requirements

A self-hosted Windows runner with the benchmark-runner label. Both .NET 8.0 and .NET Framework 4.7.2 benchmarks will run sequentially on this runner.

Testing

After merging, verify the serialization works:

  1. Trigger two workflow runs (e.g., two commits to main)
  2. Check that the second run shows "Queued" until the first completes
  3. Within a run, verify .NET Framework job waits for .NET 8.0 job
  4. Verify both benchmarks complete successfully with consistent results

🤖 Generated with Claude Code

eric-wang-1990 and others added 4 commits December 2, 2025 14:03
Switch benchmark jobs to use self-hosted runners with 'benchmark-runner'
label for consistent performance measurements.

Changes:
- .NET 8.0 job: ubuntu-latest → [self-hosted, Linux, benchmark-runner]
- .NET Framework 4.7.2 job: windows-2022 → [self-hosted, Windows, benchmark-runner]

Benefits:
- Consistent hardware specs across benchmark runs
- Predictable network performance to Databricks
- Eliminates variability from shared GitHub-hosted runners

Note: Requires self-hosted runners with 'benchmark-runner' label:
- Linux runner for .NET 8.0 benchmarks
- Windows runner for .NET Framework 4.7.2 benchmarks

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Keep .NET 8.0 job on GitHub-hosted ubuntu-latest since only Windows
self-hosted runner is available.

Changes:
- .NET 8.0 job: stays on ubuntu-latest (GitHub-hosted)
- .NET Framework 4.7.2 job: uses [self-hosted, Windows, benchmark-runner]

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
.NET 8.0 is cross-platform and runs on Windows, so both jobs can use
the same Windows self-hosted runner.

Changes:
- .NET 8.0 job: ubuntu-latest → [self-hosted, Windows, benchmark-runner]
- .NET Framework 4.7.2 job: [self-hosted, Windows, benchmark-runner] (unchanged)

Both benchmark jobs now run on the same consistent Windows hardware.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Ensure benchmarks run one at a time to prevent parallel downloads from
degrading performance measurements.

Changes:
- Updated concurrency group to queue all benchmark runs
- Set cancel-in-progress: false (queue instead of cancel)
- Made .NET Framework 4.7.2 job depend on .NET 8.0 completion

This ensures:
- Only one workflow runs at a time (no parallel workflow runs)
- Jobs run sequentially (no parallel job execution)
- Consistent network bandwidth for each benchmark
- Accurate performance measurements

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@eric-wang-1990 eric-wang-1990 added the benchmark Run performance benchmarks on this PR label Dec 2, 2025
Self-hosted runners should have .NET pre-installed to avoid permission
issues when setup-dotnet tries to write to C:\Program Files\dotnet.

Changes:
- Added condition to skip setup-dotnet on self-hosted runners
- Setup-dotnet only runs on GitHub-hosted runners now

Requirements for self-hosted runner:
- .NET 8.0 SDK must be pre-installed
- .NET Framework 4.7.2 (usually pre-installed on Windows)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@eric-wang-1990 eric-wang-1990 added benchmark Run performance benchmarks on this PR and removed benchmark Run performance benchmarks on this PR labels Dec 2, 2025
eric-wang-1990 and others added 2 commits December 2, 2025 14:18
The script uses bash syntax (heredoc, if [ -z ], etc.) but was running
in PowerShell on Windows, causing syntax errors.

Changes:
- Added 'shell: bash' to .NET 8.0 config file creation step
- .NET Framework 4.7.2 job already uses 'shell: pwsh' correctly

Requires Git Bash to be available on Windows self-hosted runner
(usually installed with Git for Windows).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Temporarily disable .NET 8.0 benchmark job due to environment issues.
Only run .NET Framework 4.7.2 benchmarks on self-hosted Windows runner.

Changes:
- Set benchmark-net8 job condition to 'false' (disabled)
- Removed dependency from benchmark-net472 job
- .NET Framework 4.7.2 job runs independently now

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@eric-wang-1990 eric-wang-1990 added benchmark Run performance benchmarks on this PR and removed benchmark Run performance benchmarks on this PR labels Dec 2, 2025
Change from 'pwsh' to 'powershell' since PowerShell Core is not
installed on the self-hosted Windows runner. Windows PowerShell
is built-in to Windows.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@eric-wang-1990 eric-wang-1990 added benchmark Run performance benchmarks on this PR and removed benchmark Run performance benchmarks on this PR labels Dec 2, 2025
eric-wang-1990 and others added 3 commits December 2, 2025 14:28
Convert build and benchmark steps from bash scripts to inline PowerShell
commands for compatibility with Windows self-hosted runner without Git Bash.

Changes:
- Build step: Direct dotnet build command in PowerShell
- Benchmark step: Direct dotnet run command in PowerShell
- All steps now use 'shell: powershell'

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Replace remaining PowerShell Core (pwsh) references with Windows
PowerShell (powershell) for self-hosted Windows runner.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@eric-wang-1990 eric-wang-1990 added benchmark Run performance benchmarks on this PR and removed benchmark Run performance benchmarks on this PR labels Dec 2, 2025
Use System.IO.File.WriteAllText with UTF8Encoding($false) to write
JSON without BOM, fixing JSON.parse() errors in github-script action.

PowerShell's Out-File -Encoding utf8 adds a BOM which causes:
"Unexpected token ''" error in JavaScript JSON parsing.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@eric-wang-1990 eric-wang-1990 added benchmark Run performance benchmarks on this PR and removed benchmark Run performance benchmarks on this PR labels Dec 2, 2025
Re-enable .NET 8.0 job now that Git Bash is installed on the runner.
Both jobs will run sequentially on the Windows self-hosted runner.

Changes:
- Re-enabled benchmark-net8 job
- Added sequential dependency (net472 waits for net8)
- Both jobs use Windows self-hosted runner with benchmark-runner label

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@eric-wang-1990 eric-wang-1990 added benchmark Run performance benchmarks on this PR and removed benchmark Run performance benchmarks on this PR labels Dec 3, 2025
The extract-data step uses bash syntax but was missing shell specification,
causing it to default to PowerShell on Windows.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@eric-wang-1990 eric-wang-1990 added benchmark Run performance benchmarks on this PR and removed benchmark Run performance benchmarks on this PR labels Dec 3, 2025
Convert extract-data and create-benchmark-data steps from bash/jq to
PowerShell to avoid requiring jq installation on Windows runner.

Changes:
- Extract-data: Uses PowerShell ConvertFrom-Json instead of jq
- Create-benchmark-data: Uses PowerShell with UTF-8 without BOM
- Both jobs now consistently use PowerShell for JSON operations

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@eric-wang-1990 eric-wang-1990 added benchmark Run performance benchmarks on this PR and removed benchmark Run performance benchmarks on this PR labels Dec 3, 2025
eric-wang-1990 and others added 2 commits December 2, 2025 22:04
The download baseline step uses bash syntax (||, mkdir -p, node) but
was missing shell specification, causing it to default to PowerShell.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@eric-wang-1990 eric-wang-1990 added benchmark Run performance benchmarks on this PR and removed benchmark Run performance benchmarks on this PR labels Dec 3, 2025
@github-actions
Copy link

github-actions bot commented Dec 3, 2025

🎯 Benchmark Results (.NET 8.0)

Metric Baseline (main) This PR Change Status
Min Execution Time (s) 0.000 3.520 New metric
Peak Memory (MB) 0.000 122.453 New metric
Allocated Memory (MB) 0.000 283.970 New metric
Gen2 Collections 0.000 46.000 New metric

Indicators:

  • 🟢 Improvement - Metric improved by >30%
  • No significant change - Within ±30%
  • ⚠️ Regression - Metric degraded by >30%
  • New metric - No baseline data available

📊 View detailed results

@github-actions
Copy link

github-actions bot commented Dec 3, 2025

🎯 Benchmark Results (.NET Framework 4.7.2)

Metric Baseline (main) This PR Change Status
Min Execution Time (s) 0.000 3.972 New metric
Peak Memory (MB) 0.000 328.230 New metric
Allocated Memory (MB) 0.000 502.620 New metric
Gen2 Collections 0.000 10.000 New metric

Indicators:

  • 🟢 Improvement - Metric improved by >30%
  • No significant change - Within ±30%
  • ⚠️ Regression - Metric degraded by >30%
  • New metric - No baseline data available

📊 View detailed results

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

benchmark Run performance benchmarks on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants