Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/t/perf/generate-repo-p5413-connectivity-check.perl # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / t / perf / generate-repo-p5413-connectivity-check.perl` 44 lines ยท 1225 bytes Raw Blame History 1 #!/usr/bin/perl 2 # 3 # Generate a fast-import stream for p5413 connectivity check benchmarks. 4 # 5 # Usage: generate-repo-p5413-connectivity-check.perl 6 # [] [] 7 # 8 # Creates one initial commit with dirs*files_per_dir files, then 9 # additional commits each modifying 10 # files in directories chosen round-robin from 1... 11 12 use strict; 13 use warnings; 14 15 my ($nd, $nf, $nc, $hot, $fpc) = @ARGV; 16 $hot = $nd if !$hot || $hot > $nd; 17 $fpc = 1 if !$fpc; 18 19 sub data { 20 printf "data %d\n%s\n", length($_[0]), $_[0]; 21 } 22 23 # Initial tree: one commit with nd*nf files. 24 printf "commit refs/heads/main\n"; 25 printf "committer perf now\n"; 26 data("initial"); 27 for my $d (1..$nd) { 28 for my $f (1..$nf) { 29 printf "M 100644 inline d-%04d/f-%03d\n", $d, $f; 30 data(sprintf "%03d%03d", $d, $f); 31 } 32 } 33 34 # Subsequent commits (auto-chained by fast-import). 35 for my $i (1..$nc) { 36 printf "commit refs/heads/main\n"; 37 printf "committer perf now\n"; 38 data(sprintf "change-%03d", $i); 39 for my $j (0..$fpc-1) { 40 my $d = (($i + $j) % $hot) + 1; 41 printf "M 100644 inline d-%04d/f-001\n", $d; 42 data(sprintf "c%d-%d", $i, $j); 43 } 44 }