Skip to content

perf: optimize hot path allocations in mutation engine pipeline#86

Closed
rian-be wants to merge 1 commit into
developfrom
perf/optimize-hotpath-allocations
Closed

perf: optimize hot path allocations in mutation engine pipeline#86
rian-be wants to merge 1 commit into
developfrom
perf/optimize-hotpath-allocations

Conversation

@rian-be

@rian-be rian-be commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Reduce heap allocations on the mutation execution hot path by removing redundant per-call array copies and replacing Guid-based execution identifiers with a lightweight counter.

Changes

  • InterceptorPipeline: double-checked locking with volatile snapshot cache + ArrayPool for filtered results + [MethodImpl(AggressiveInlining)]
  • MutationEngine: Interlocked.Increment hex counter instead of Guid.NewGuid().ToString()
  • Benchmarks: RESULTS.md + RESULTS-OPTIMIZED.md with before/after comparison

Benchmark Results

Benchmark Before After Δ
NoInterceptor_Baseline 2.161 us / 3.12 KB 1.601 us / 3.00 KB -25.9%
PassiveInterceptor_Enabled 2.252 us / 3.30 KB 1.661 us / 3.00 KB -26.2%
Commit_Performance_NoPolicy 4.349 us 4.027 us -7.4%
Commit_Strict_WithPolicy 5.878 us 5.277 us -10.2%

Notes

  • executionId format zmienia się z GUID na hex (np. 0000002a)
  • Brak zmian w public API

@github-actions github-actions Bot added the benchmark Benchmark coverage and performance measurement changes label Jul 27, 2026
@github-actions github-actions Bot added the performance Performance improvements or regressions label Jul 27, 2026
@rian-be rian-be closed this Jul 27, 2026
@rian-be
rian-be deleted the perf/optimize-hotpath-allocations branch July 27, 2026 00:20
@rian-be rian-be changed the title perf: optimize hot-path allocations in mutation engine pipeline perf: optimize hot path allocations in mutation engine pipeline Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

benchmark Benchmark coverage and performance measurement changes performance Performance improvements or regressions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant