Skip to content

Conversation

@sksat
Copy link
Member

@sksat sksat commented Sep 4, 2025

概要

C2A_DEV_RUNTIME_SPEED 環境変数を使って、c2a-dev-runtime の動作速度を可変にする

影響範囲

c2a-dev-runtime

@sksat sksat requested a review from ToshiAki64 September 4, 2025 08:11
@sksat sksat self-assigned this Sep 4, 2025
Copilot AI review requested due to automatic review settings September 4, 2025 08:11
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces dynamic runtime speed control for the c2a-dev-runtime through the C2A_DEV_RUNTIME_SPEED environment variable, allowing developers to adjust the simulation speed.

  • Adds environment variable-based speed multiplier configuration
  • Replaces fixed update interval with dynamically calculated duration
  • Includes validation to ensure positive speed multiplier values

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +23 to +24
let base_millis = DEFAULT_UPDATE_BATCH_IN_REALTIME.as_millis() as f64;
let adjusted_millis = (base_millis / *SPEED_MULTIPLIER).max(1.0) as u64;
Copy link

Copilot AI Sep 4, 2025

Choose a reason for hiding this comment

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

The SPEED_MULTIPLIER is dereferenced every time UPDATE_INTERVAL is accessed. Consider storing the calculated interval value directly in the LazyLock to avoid repeated division operations during runtime.

Copilot uses AI. Check for mistakes.
@sksat sksat merged commit 2a31ad8 into main Sep 4, 2025
37 checks passed
@sksat sksat deleted the feature/speedup-dev-runtime branch September 4, 2025 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants