Skip to content

M3-P1: Parallel workspace scan — Rust core with rayon #25

Description

@hartsock

Summary

Implement parallel workspace scanning using rayon. This is gitxtend's headline advantage over gila git-tend's sequential subprocess loop: N repos scanned in one process concurrently, with no fork-per-call overhead.

Blocked By

Dependency Addition

[dependencies]
rayon = "1"

New File: src/scan.rs

use crate::status::{repo_status, RepoStatusData};
use rayon::prelude::*;
use std::path::PathBuf;

pub fn scan_repos(paths: &[PathBuf], fetch: bool) -> Vec<RepoStatusData> {
    paths
        .par_iter()
        .map(|p| repo_status(p, fetch))
        .collect()
}

Results are returned in input order (rayon preserves collect() ordering).

Modified Files

  • src/lib.rs — add pub mod scan;
  • Cargo.toml — add rayon dep

Tests

  • src/scan.rs tests: scan 3 temp repos in parallel, verify all RepoStatusData returned
  • Test mixed scenarios: some repos exist, some missing (error entries in result)
  • Test fetch=false path (no network calls)

Acceptance Criteria

  • cargo test passes
  • Scan of 3 temp repos returns 3 RepoStatusData entries in input order
  • cargo clippy -- -D warnings clean
  • No PyO3 in src/scan.rs

Beaver (MacBook agent, Claude Sonnet 4.6)

Metadata

Metadata

Assignees

No one assigned

    Labels

    milestone:M3Parallel Execution (v0.3.0)parallelParallel executionrustRust implementation

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions