-
Notifications
You must be signed in to change notification settings - Fork 2
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
Conversation
cf86eeb
to
70c2384
Compare
@@ -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" |
There was a problem hiding this comment.
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
2512b4c
to
18797c0
Compare
18797c0
to
7a023d9
Compare
} | ||
|
||
fn matches_globs(path: &Path, globs: &[String]) -> bool { | ||
globs.iter().any(|glob| glob_match(glob, path.to_str().unwrap())) |
There was a problem hiding this comment.
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
There was a problem hiding this 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
Project
build speed by using rayon to build project entries in parallelignore::WalkBuilder
iteratorProjectBuilder
for clarityNotes
The
ph/jwalk
branch contains all the approaches I tried along with a way to run benchmarks