Skip to content

Conversation

@perryqh
Copy link
Contributor

@perryqh perryqh commented Aug 11, 2025

AI assisted for-file optimization.

Also used in https://github.com/rubyatscale/fast_code_owners

Notes

The old for-file code will be removed in a follow up PR

@perryqh perryqh force-pushed the ph.blazing-fast-for-file branch from 5d99ebd to 66c46e9 Compare August 11, 2025 16:55
for_file_from_codeowners(run_config, file_path)
} else {
run_with_runner(run_config, |runner| runner.for_file(file_path))
//run_with_runner(run_config, |runner| runner.for_file(file_path))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Leaving the old code for now

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.

I ran the compare_for_file against a large project, and all results matched except in cases where the team was correct but the reason was more specific. 💯


hyperfine --warmup=2 --runs=3 --export-markdown tmp/codeowners_for_file_benchmarks.md \
"../rubyatscale/codeowners-rs/target/release/codeowners for-file \"$1\"" \
"bin/codeowners for_file \"$1\"" \
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"bin/codeowners for_file \"$1\"" \
"bin/codeowners-rs for-file \"$1\"" \

Copy link
Contributor

Choose a reason for hiding this comment

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

Command Mean [ms] Min [ms] Max [ms] Relative
../rubyatscale/codeowners-rs/target/release/codeowners for-file "packs/technical_services/addresses/addresses/app/public/addresses.rb" 23.1 ± 9.7 14.8 33.7 1.00
bin/codeowners-rs for-file "packs/technical_services/addresses/addresses/app/public/addresses.rb" 4031.4 ± 32.1 4007.7 4067.9 174.56 ± 73.17
bin/codeownership for_file "packs/technical_services/addresses/addresses/app/public/addresses.rb" 812.9 ± 18.0 799.1 833.2 35.20 ± 14.77

hyperfine --warmup=2 --runs=3 --export-markdown tmp/codeowners_benchmarks_gv.md \
'../rubyatscale/codeowners-rs/target/release/codeowners gv' \
'bin/codeowners-rs gv'
'bin/codeowners validate' \
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
'bin/codeowners validate' \
'bin/codeowners-rs validate' \

Copy link
Contributor

Choose a reason for hiding this comment

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

Command Mean [s] Min [s] Max [s] Relative
../rubyatscale/codeowners-rs/target/release/codeowners gv 3.492 ± 0.040 3.447 3.522 1.00
bin/codeowners-rs validate 4.857 ± 0.107 4.772 4.976 1.39 ± 0.03
bin/codeownership validate 60.224 ± 0.473 59.868 60.761 17.25 ± 0.24

🔥

@perryqh perryqh merged commit ae6332e into main Aug 12, 2025
9 checks passed
@github-project-automation github-project-automation bot moved this from Triage to Done in Modularity Aug 12, 2025
@perryqh perryqh deleted the ph.blazing-fast-for-file branch September 5, 2025 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants