Skip to content

test(runtime): add scheduler service latency benchmark - #1016

Merged
Coldwings merged 1 commit into
mainfrom
test/scheduler-service-latency
Aug 12, 2026
Merged

test(runtime): add scheduler service latency benchmark#1016
Coldwings merged 1 commit into
mainfrom
test/scheduler-service-latency

Conversation

@Coldwings

Copy link
Copy Markdown
Owner

Description

Adds a focused mixed-workload benchmark for scheduler service latency. It measures how long a single worker takes to service an already-armed I/O completion and a remote MPSC-inbox submission while a yield loop keeps the local runnable deque non-empty.

The benchmark reports p50, p99, and maximum latency, records the selected I/O backend, refuses to mix samples from different backends, and bounds every setup/completion/shutdown phase. Its --smoke mode is added to Release CI only as build-and-termination coverage; noisy shared-runner timing values are deliberately not pass/fail thresholds.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Performance improvement (optimization that improves speed/memory usage)
  • Documentation (changes to documentation, comments, or examples)
  • Refactoring (code changes that neither fix bugs nor add features)
  • Tests (adding or modifying tests)
  • Build/CI (changes to build system, CI configuration, or dependencies)

Related Issues

Closes #1015

Changes Made

Core Changes

  • Added scheduler_service_benchmark with configurable trial count and backlog duration.
  • Added a short CI smoke invocation without timing thresholds.
  • Documented the benchmark, measurement semantics, and interpretation guidance in README, wiki, and changelog.

API Changes

None.

Testing

Unit Tests

  • Added benchmark termination coverage in CI
  • Existing scheduler tests pass locally
  • Existing I/O tests pass locally

Sanitizer Testing

  • Instrumented benchmark smoke passed with ASAN and leak detection
  • Instrumented benchmark smoke passed with TSAN
  • No sanitizer reports

Test Results

Release build with developer warnings and -Werror:
  scheduler_service_benchmark built successfully

scheduler_service_benchmark --smoke:
  3/3 trials completed

scheduler_service_benchmark (40 trials, 20 ms backlog, io_uring):
  I/O p50=20.08 ms, p99=20.17 ms
  remote inbox p50=20.08 ms, p99=20.16 ms

elio_tests "[scheduler]":
  408 assertions in 73 test cases passed

elio_tests "[io]":
  699 assertions in 75 test cases passed

ASAN smoke: passed with leak detection
TSAN smoke: passed with no race report

GCC emits its existing atomic_thread_fence is not supported with -fsanitize=thread warnings from runtime headers, so the standalone TSAN benchmark build disabled warnings-as-errors while retaining TSAN instrumentation and halt-on-error behavior.

Checklist

Code Quality

  • Code follows the project style
  • No debug code, TODOs, or commented-out code
  • Release build produces no new warnings under -Werror

Documentation

  • Updated README, wiki, and changelog
  • Documented benchmark options and result interpretation

Testing

  • Added coverage that proves the benchmark builds and terminates
  • Relevant existing tests pass locally
  • Tested with ASAN and TSAN

Compatibility

  • Backward compatible; no public API change
  • Linux-only eventfd dependency matches Elio's supported platform

Performance

  • Measurement does not impose unstable timing thresholds in CI
  • Baseline captures the intended current scheduler service delay

Reviewer Guidance

Please focus on:

  • whether the armed-I/O and remote-inbox setup isolates scheduler service delay correctly;
  • whether release/acquire publication and failure cleanup keep all task state alive until shutdown;
  • whether the smoke mode is appropriately bounded and non-flaky across io_uring and epoll fallback environments.

Copilot AI balanced review requested due to automatic review settings August 12, 2026 07:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a focused scheduler service-latency benchmark for armed I/O and remote inbox work under sustained runnable load.

Changes:

  • Adds configurable trials, smoke mode, percentile reporting, and bounded cleanup.
  • Integrates a Release CI smoke run.
  • Documents usage and measurement interpretation.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
examples/scheduler_service_benchmark.cpp Implements the benchmark.
examples/CMakeLists.txt Adds the benchmark target.
.github/workflows/ci.yml Runs smoke coverage in Release CI.
README.md Lists benchmark build and run commands.
wiki/Performance-Tuning.md Documents interpretation guidance.
CHANGELOG.md Records the new benchmark.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@Coldwings
Coldwings merged commit 5d6811b into main Aug 12, 2026
11 checks passed
@Coldwings
Coldwings deleted the test/scheduler-service-latency branch August 12, 2026 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Tests] Add mixed scheduler service-latency benchmarks

2 participants