Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improving project build speed #44

Merged
merged 2 commits into from
Nov 12, 2024
Merged

Improving project build speed #44

merged 2 commits into from
Nov 12, 2024

Conversation

perryqh
Copy link
Contributor

@perryqh perryqh commented Nov 10, 2024

  • Improving Project build speed by using rayon to build project entries in parallel
  • checking for file annotations in the initial ignore::WalkBuilder iterator
  • introducing a new ProjectBuilder for clarity

Notes

The ph/jwalk branch contains all the approaches I tried along with a way to run benchmarks

@perryqh perryqh force-pushed the ph/faster-build-project branch from cf86eeb to 70c2384 Compare November 10, 2024 23:52
@@ -10,10 +10,11 @@ debug = true
clap = { version = "4.5.20", features = ["derive"] }
clap_derive = "4.5.18"
error-stack = "0.5.0"
glob-match = "0.2.1"
fast-glob = "0.4.0"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't fix any bugs, but is at least maintained

@perryqh perryqh force-pushed the ph/faster-build-project branch 3 times, most recently from 2512b4c to 18797c0 Compare November 11, 2024 13:30
@perryqh perryqh force-pushed the ph/faster-build-project branch from 18797c0 to 7a023d9 Compare November 11, 2024 20:37
}

fn matches_globs(path: &Path, globs: &[String]) -> bool {
globs.iter().any(|glob| glob_match(glob, path.to_str().unwrap()))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is remarkably fast. I tried caching the results of this with no performance boost

Copy link
Contributor

@jackboberg jackboberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my local testing, this is faster on a large project

bin/codeowners-rs is the current release

$ hyperfine --warmup 1 'codeowners validate' 'bin/codeowners-rs validate'
Benchmark 1: codeowners validate
  Time (mean ± σ):      6.384 s ±  0.050 s    [User: 6.999 s, System: 5.553 s]
  Range (min … max):    6.340 s …  6.512 s    10 runs

Benchmark 2: bin/codeowners-rs validate
  Time (mean ± σ):      6.820 s ±  0.783 s    [User: 8.947 s, System: 33.606 s]
  Range (min … max):    5.646 s …  7.494 s    10 runs

Summary
  codeowners validate ran
    1.07 ± 0.12 times faster than bin/codeowners-rs validate 

@perryqh perryqh merged commit 0d200e4 into main Nov 12, 2024
9 checks passed
@perryqh perryqh deleted the ph/faster-build-project branch November 14, 2024 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants