Skip to content

Conversation

@GuillaumeLagrange
Copy link
Contributor

instrumentation is still accepted as an input, but it maps to simulation internally, as we plan to phase it out.

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 renames the "instrumentation" mode to "simulation" throughout the codebase while maintaining backward compatibility. The environment variable CODSPEED_RUNNER_MODE now accepts both "instrumentation" (deprecated) and "simulation" (preferred), with both values mapping to the same "simulation" mode internally.

Key Changes:

  • Core mode handling updated to accept both "instrumentation" and "simulation" values for backward compatibility
  • File renames: instrumented.tssimulation.ts in both vitest-plugin and tinybench-plugin packages
  • Class and function renames: InstrumentedRunnerSimulationRunner, runInstrumentedBenchrunSimulationBench, etc.

Reviewed Changes

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

Show a summary per file
File Description
packages/core/src/index.ts Updated type definition and logic to map both "instrumentation" and "simulation" to "simulation" mode
packages/core/src/introspection.ts Updated mode check from "instrumented" to "simulation"
packages/vitest-plugin/src/simulation.ts Renamed file and all internal functions/classes from "Instrumented" to "Simulation"
packages/vitest-plugin/src/runner.ts Updated import to use SimulationRunner from simulation module
packages/vitest-plugin/src/index.ts Updated mode check to compare against "simulation" instead of "instrumented"
packages/vitest-plugin/src/__tests__/instrumented.test.ts Updated import to use SimulationRunner from simulation module
packages/vitest-plugin/src/__tests__/index.test.ts Updated expected runner path to reference simulation.ts
packages/vitest-plugin/rollup.config.ts Updated build configuration to output simulation.mjs instead of instrumented.mjs
packages/tinybench-plugin/src/simulation.ts Renamed file and all internal functions/classes from "Instrumented" to "Simulation"
packages/tinybench-plugin/src/index.ts Updated import and mode check to use "simulation"
packages/tinybench-plugin/src/index.unit.test.ts Added tests for both "instrumentation" (backward compatibility) and "simulation" modes
packages/tinybench-plugin/tests/__snapshots__/index.integ.test.ts.snap Updated snapshot to reflect "simulation mode" in console output

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@GuillaumeLagrange GuillaumeLagrange changed the title feat: accept rename instrumentation to simulation feat: rename instrumentation to simulation Nov 21, 2025
@GuillaumeLagrange GuillaumeLagrange force-pushed the cod-1441-accept-simulation-as-a-value-instrumentation-which-is-now branch from c8e08ba to 5ee0428 Compare November 21, 2025 11:06
@GuillaumeLagrange GuillaumeLagrange marked this pull request as ready for review November 21, 2025 11:06
@codspeed-hq
Copy link

codspeed-hq bot commented Nov 21, 2025

CodSpeed Performance Report

Merging #68 will degrade performances by 55.87%

Comparing cod-1441-accept-simulation-as-a-value-instrumentation-which-is-now (635c77c) with main (2e31d9e)1

Summary

⚡ 1 improvement
❌ 3 regressions
✅ 126 untouched

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Mode Benchmark BASE HEAD Change
Simulation wait 500ms 8.6 ms 12.2 ms -30.13%
Simulation short body 132.9 µs 301.3 µs -55.87%
WallTime short body 2 µs 1.7 µs +13.19%
Simulation wait 500ms 10.4 ms 12.5 ms -16.52%

Footnotes

  1. No successful run was found on main (635c77c) during the generation of this report, so 2e31d9e was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

`instrumentation` is still accepted as an input, but it maps to
simulation internally, as we plan to phase it out.
@GuillaumeLagrange GuillaumeLagrange force-pushed the cod-1441-accept-simulation-as-a-value-instrumentation-which-is-now branch from 5ee0428 to 635c77c Compare November 24, 2025 13:53
@GuillaumeLagrange GuillaumeLagrange merged commit 635c77c into main Nov 24, 2025
15 checks passed
@GuillaumeLagrange GuillaumeLagrange deleted the cod-1441-accept-simulation-as-a-value-instrumentation-which-is-now branch November 24, 2025 14:03
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.

3 participants