Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .alfonso/release-notes/next/perf-spawn-without-fork.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Daemon CPU on macOS: formatters, checkers and git probes no longer fork the daemon (they start through posix_spawn), and the per-edit git root-commit probe is reused until the repository's git files change; forking a large multi-threaded daemon took every malloc lock and stalled allocation process-wide.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"targeted_mechanism": "none",
"kind": "harness",
"slice_class": "engine_unwired",
"fixtures": [
"crates/aft/tests/integration/tool_call_parity_test.rs"
],
"fenced_files": [
"crates/aft/src/search_index.rs"
],
"note": "The only fenced change caches the git root-commit probe used for artifact cache keys, invalidated by a stamp of the repository's git files; search inputs are unchanged. Ranking and routing are unchanged; benchmark rows must remain byte-identical."
}
2 changes: 2 additions & 0 deletions crates/aft/src/alias/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -785,6 +785,7 @@ pub fn head_tree_entries(repo_root: &Path) -> Result<Vec<TrackedPath>, AliasErro
});
}
let output = crate::effective_path::new_command("git")
.build()
.arg("-C")
.arg(repo_root)
.args(["ls-tree", "-r", "-z", "HEAD"])
Expand Down Expand Up @@ -920,6 +921,7 @@ fn git_filter_attributes(
let started_at = Instant::now();
let output = run_command_with_input(
crate::effective_path::new_command("git")
.build()
.arg("-C")
.arg(repo_root)
.args(["check-attr", "--cached", "-z", "--stdin", "filter"]),
Expand Down
1 change: 1 addition & 0 deletions crates/aft/src/commands/callgraph_borrowed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,7 @@ fn git_paths(root: &Path, args: &[&str]) -> Option<HashSet<String>> {
return None;
}
let mut child = crate::effective_path::new_command("git")
.build()
.arg("-C")
.arg(root)
.args(args)
Expand Down
2 changes: 2 additions & 0 deletions crates/aft/src/commands/configure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1558,6 +1558,7 @@ fn detect_worktree_bridge(ctx: &AppContext, project_root: &Path) -> (bool, Optio
#[cfg(test)]
ctx.record_worktree_bridge_probe_spawn_for_test();
let output = crate::effective_path::new_command("git")
.build()
.arg("-C")
.arg(project_root)
.args([
Expand Down Expand Up @@ -7539,6 +7540,7 @@ thread_local! {

fn view_git_changed_paths(root: &Path, max_examined: usize) -> Result<BTreeSet<Vec<u8>>, String> {
let child = crate::effective_path::new_command("git")
.build()
.arg("-C")
.arg(root)
.args([
Expand Down
5 changes: 5 additions & 0 deletions crates/aft/src/commands/conflicts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ fn git_toplevel(base_path: &Path) -> Result<PathBuf, String> {
return Err(crate::developer_tools::MISSING_DEVELOPER_TOOLS_REASON.to_string());
}
let output = crate::effective_path::new_command("git")
.build()
.args(["rev-parse", "--show-toplevel"])
.current_dir(working_dir)
.output()
Expand Down Expand Up @@ -84,6 +85,7 @@ fn discover_conflicted_files(
let mut unmerged_files = HashSet::new();

let output = crate::effective_path::new_command("git")
.build()
.args(["ls-files", "--unmerged", "-z"])
.current_dir(&toplevel)
.output()
Expand All @@ -110,6 +112,7 @@ fn discover_conflicted_files(

let mut sweep_error = None;
match crate::effective_path::new_command("git")
.build()
.args(["grep", "-z", "-lE", r"^(<<<<<<< |>>>>>>> )"])
.current_dir(&toplevel)
.output()
Expand Down Expand Up @@ -560,12 +563,14 @@ line 6"#;
.expect("write conflicted file");

let init = crate::effective_path::new_command("git")
.build()
.args(["init", "--quiet"])
.current_dir(&repo)
.status()
.expect("run git init");
assert!(init.success(), "git init failed: {init}");
let add = crate::effective_path::new_command("git")
.build()
.args(["add", "conflicted.txt"])
.current_dir(&repo)
.status()
Expand Down
Loading
Loading