Skip to content

Commit 6e6860c

Browse files
authored
Stabilize CompileWorkflow_WithMCP benchmark to remove warning-path overhead (#47698)
1 parent 30bd79a commit 6e6860c

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

pkg/workflow/compiler_benchmark_test.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,15 @@ on:
6767
permissions:
6868
contents: read
6969
pull-requests: read
70+
actions: read
71+
issues: read
7072
engine: copilot
7173
tools:
7274
github:
7375
mode: remote
7476
toolsets: [default, actions]
7577
playwright:
78+
mode: cli
7679
version: "v1.41.0"
7780
edit:
7881
bash: ["git status", "git diff"]
@@ -89,7 +92,14 @@ Review the pull request changes and provide feedback.
8992
b.Fatal(err)
9093
}
9194

92-
compiler := NewCompiler()
95+
compiler := NewCompiler(WithNoEmit(true))
96+
compiler.SetQuiet(true)
97+
compiler.SetApprove(true)
98+
99+
// Warm up: run once before timing to prime one-time caches (schema compilation, etc.)
100+
if err := compiler.CompileWorkflow(testFile); err != nil {
101+
b.Fatalf("warm-up compile failed: %v", err)
102+
}
93103

94104
for b.Loop() {
95105
_ = compiler.CompileWorkflow(testFile)

pkg/workflow/compiler_performance_benchmark_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ permissions:
129129
contents: read
130130
pull-requests: read
131131
actions: read
132+
issues: read
132133
engine: copilot
133134
tools:
134135
github:
@@ -159,7 +160,9 @@ Review and test the pull request with multiple tools.
159160
compiler.SetApprove(true)
160161

161162
// Warm up: run once before timing to prime one-time caches (schema compilation, etc.)
162-
_ = compiler.CompileWorkflow(testFile)
163+
if err := compiler.CompileWorkflow(testFile); err != nil {
164+
b.Fatalf("warm-up compile failed: %v", err)
165+
}
163166

164167
b.ResetTimer()
165168
b.ReportAllocs()

0 commit comments

Comments
 (0)