OpenRakis / OpenRakis/Spice86

Feature request: benchmark mode

Open
#1,114 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement performance
Dominant language
C#
Stars
658
Forks
48
Avg merge
8h 33m
Merged PRs (30d)
5

Description

Summary

Add a headless "benchmark" mode to the emulator, allowing it to execute a given DOS program as fast as possible without UI rendering, while collecting performance metrics. This will enable easier performance testing, regression detection, and optimization validation.

Use Case & Motivation
  • Measure execution speed under different configurations (e.g., changes in CPU emulation, memory management, or instruction handling).
  • Detect performance regressions when modifying the emulator.
  • Compare execution time across different versions of the emulator.
  • Automate benchmarking for continuous performance tracking.
Proposed Implementation
  1. Command-Line Mode:

    • Introduce a CLI flag (e.g., --benchmark <path_to_executable>) to launch the emulator in benchmark mode.
    • Optionally allow specifying parameters such as:
      • --max-instructions <N> to limit execution.
      • --timeout <seconds> to prevent infinite loops.
  2. Performance Metrics Collection:

    • Measure total execution time.
    • Count executed instructions.
    • Track cycle counts and key statistics (e.g., opcode distribution, memory access patterns).
    • Optionally output a JSON or CSV report (--output <file>).
  3. Exit Conditions:

    • Program terminates normally.
    • Reaches a configured instruction/time limit.
    • Encounters an unsupported instruction or exception.
Optional Enhancements (Future Work)
  • Support deterministic replays for comparing different versions.
  • Profiling integration (e.g., detailed breakdown of CPU/memory usage).
  • Compare multiple emulator builds automatically and report differences.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files, tests, or entry points are identified. Start by locating the command-line startup path and emulator execution loop, then define the smallest benchmark slice before adding limits and metrics. Done should include headless execution, documented exit conditions, and a machine-readable performance report.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
cli, performance, reverse-engineering
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.