Skip to content

perf(goexec): benchmark Go scheduler and cache stealing peers - #101

Merged
kdy1 merged 2 commits into
mainfrom
kdy1/goexec-go-scheduler-benchmarks
Sep 17, 2026
Merged

kdy1 merged 2 commits into
mainfrom
kdy1/goexec-go-scheduler-benchmarks

Conversation

@kdy1

@kdy1 kdy1 commented Sep 17, 2026 •

Copy link
Copy Markdown
Member

Each scheduler checkpoint rebuilt every worker's stealing-peer list under the scheduler mutex, adding allocation and reference-count traffic as worker counts grew. Cache each worker's rotated peer list until the worker set grows, and publish its single-writer poll counter with atomic stores instead of read-modify-write operations. Checkpoint frequency, handoff policy, return priority, and thread/permit limits remain unchanged.

Add a Go companion benchmark and a reproducible runner covering cooperative yields, empty blocking boundaries, cached reads, CPU work, blocking socket waits, and mixed workloads. The runner records shuffled serial repetitions, environment metadata, binary hashes, raw CSV, and median/min/max summaries under the ignored target directory; generated result files are not checked in. A deterministic regression test verifies that existing workers discover work on newly added workers.

Measurements and limitations

  • On an M3 Max with Go 1.25.1, five repetitions at 16 execution permits improved goexec's yield/empty throughput by approximately 2.7× over the previous scheduler.
  • This is not a universal improvement: longer seven-repeat measurements at four permits showed approximately 12–18% regressions for yield/empty workloads. CPU and I/O improvements were small or variable; some Go workloads remained faster.
  • Go socket waits use blocking syscall.Read/Write with external Rust peers. These results do not measure Go's network poller or general application performance, and explicit Gosched differs from local future rescheduling.
  • Full methodology, results, regressions, and reproduction commands are in BENCHMARKS.md.

Validation

  • cargo fmt --all -- --check
  • cargo clippy -p goexec --all-targets --locked -- -D warnings
  • cargo test -p goexec --locked: 33 unit/integration/doc tests passed
  • cargo test -p goexec --locked --features loom --lib: six models passed
  • Go formatting and go vet; Go companion built with -race, with no races reported
  • Latency smoke test: all 30 combinations of five engines and six workloads passed
  • Verified 270 recorded runs and all 54 median/min/max summaries

Rust commands used RUSTC_WRAPPER= because the host's configured sccache was unavailable.

@kdy1
kdy1 merged commit 79d7a27 into main Sep 17, 2026
14 checks passed
@kdy1
kdy1 deleted the kdy1/goexec-go-scheduler-benchmarks branch September 17, 2026 03:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant