Skip to content

[Benchmark]: Measure side effect and result materialization #60

Description

@rian-be

Summary

Benchmark side effect and result materialization in the core mutation runtime.

Goal

Measure the cost of creating MutationResult objects, materializing side effects, and producing change set or history output so the runtime's output path remains visible as the engine evolves.

Problem

Even when the core engine executes mutations quickly, the cost of building the final result object graph can still become meaningful part of total runtime. That includes result creation, side effect materialization, and any change set or history output produced for downstream consumers.

Without dedicated benchmark, changes in those output paths can go unnoticed until they show up in broader throughput or memory regressions.

Scope

  • Benchmark MutationResult creation cost in the core runtime
  • Benchmark side effect materialization cost
  • Benchmark change set or history output materialization cost
  • Keep the benchmark focused on core runtime result-building behavior
  • Reuse existing benchmark helpers where they already exist
  • Make the benchmark scenarios explicit enough to compare output path costs over time

Design Expectations

  • Result materialization should be measured separately from raw mutation application where possible.
  • Side effect and history output should be benchmarked as distinct concerns if they have different cost profiles.
  • The benchmark setup should remain minimal and deterministic.
  • Helper code should stay local to the benchmark project.
  • Scenario names should make it clear which output path is being measured.

Suggested Measurements

  • MutationResult creation with no side effects
  • MutationResult creation with one or more side effects
  • change set / history output materialization for executed mutations

Acceptance Criteria

  • MutationResult creation is benchmarked in the core runtime
  • Side effect materialization is benchmarked as distinct concern
  • Change set or history output materialization is benchmarked as distinct concern
  • The benchmark results make output path costs visible and comparable
  • The benchmark remains centered on the core runtime and not provider behavior

Non-Goals

  • This issue does not change how results are produced
  • This issue does not add provider specific output benchmarks
  • This issue does not optimize result creation prematurely
  • This issue does not change runtime behavior

Notes

This issue is child of the benchmark umbrella #55.

Metadata

Metadata

Assignees

No one assigned

    Labels

    benchmarkBenchmark coverage and performance measurement changes

    Type

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions