Skip to content

Commit 34e4785

Browse files
authored
Merge pull request #267 from acunniffe/fix/bench-perf
Fix performance of performance suite
2 parents 64a603f + 27e485a commit 34e4785

File tree

3 files changed

+288
-128
lines changed

3 files changed

+288
-128
lines changed

src/observability/wrapper_performance_targets.rs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,23 @@ pub fn log_performance_for_checkpoint(
9999
duration: Duration,
100100
checkpoint_kind: CheckpointKind,
101101
) {
102-
if Duration::from_millis(50 * files_edited as u64) >= duration {
102+
let within_target = Duration::from_millis(50 * files_edited as u64) >= duration;
103+
104+
// Output structured JSON for benchmarking (when GIT_AI_DEBUG_PERFORMANCE >= 2)
105+
// For git-ai commands like checkpoint, there's no pre/post/git breakdown - just total time
106+
let perf_json = json!({
107+
"command": "checkpoint",
108+
"total_duration_ms": duration.as_millis(),
109+
"git_duration_ms": 0,
110+
"pre_command_duration_ms": 0,
111+
"post_command_duration_ms": 0,
112+
"files_edited": files_edited,
113+
"checkpoint_kind": checkpoint_kind.to_string(),
114+
"within_target": within_target,
115+
});
116+
debug_performance_log_structured(perf_json);
117+
118+
if !within_target {
103119
log_performance(
104120
"checkpoint",
105121
duration,

0 commit comments

Comments
 (0)