From c88f405069997fd6408c0d17cba5e377a1aeaf15 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 23 Mar 2026 18:58:31 +0000 Subject: [PATCH] refactor: standardize benchmark warm-up comments and add missing warm-up to BenchmarkYAMLGeneration - Unify all 7 warm-up comments to the same phrasing: "Warm up: run once before timing to prime one-time caches (schema compilation, etc.)" - Remove redundant '// Track memory allocations' comment in BenchmarkCompileMemoryUsage - Add missing warm-up + b.ResetTimer() to BenchmarkYAMLGeneration, consistent with all other benchmarks Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- pkg/workflow/compiler_performance_benchmark_test.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pkg/workflow/compiler_performance_benchmark_test.go b/pkg/workflow/compiler_performance_benchmark_test.go index 0ea98c9e505..d66edd7fc39 100644 --- a/pkg/workflow/compiler_performance_benchmark_test.go +++ b/pkg/workflow/compiler_performance_benchmark_test.go @@ -206,14 +206,11 @@ Standard workflow for memory profiling. compiler := NewCompiler(WithNoEmit(true)) - // Warm up: run once before timing to initialize one-time caches - // (schema compilation, regex caches) so they don't skew per-op metrics. + // Warm up: run once before timing to prime one-time caches (schema compilation, etc.) _ = compiler.CompileWorkflow(testFile) b.ResetTimer() b.ReportAllocs() - - // Track memory allocations for b.Loop() { _ = compiler.CompileWorkflow(testFile) } @@ -249,7 +246,7 @@ Test parsing performance. compiler := NewCompiler() - // Warm up: prime the schema compilation cache before timed measurement. + // Warm up: run once before timing to prime one-time caches (schema compilation, etc.) _, _ = compiler.ParseWorkflowFile(testFile) b.ResetTimer() @@ -295,7 +292,7 @@ Test validation performance. compiler := NewCompiler(WithNoEmit(true)) compiler.SetStrictMode(true) - // Warm up: prime the schema compilation cache before timed measurement. + // Warm up: run once before timing to prime one-time caches (schema compilation, etc.) _ = compiler.CompileWorkflow(testFile) b.ResetTimer() @@ -335,6 +332,10 @@ Test YAML generation. compiler := NewCompiler() compiler.SetNoEmit(true) + // Warm up: run once before timing to prime one-time caches (schema compilation, etc.) + _ = compiler.CompileWorkflow(testFile) + + b.ResetTimer() b.ReportAllocs() for b.Loop() { _ = compiler.CompileWorkflow(testFile)