|
| 1 | +#!/bin/sh |
| 2 | + |
| 3 | +test_description='Tests pack performance using bitmaps' |
| 4 | +. ./perf-lib.sh |
| 5 | + |
| 6 | +GIT_TEST_PASSING_SANITIZE_LEAK=0 |
| 7 | +export GIT_TEST_PASSING_SANITIZE_LEAK |
| 8 | + |
| 9 | +test_perf_large_repo |
| 10 | + |
| 11 | +test_expect_success 'create rev input' ' |
| 12 | + cat >in-thin <<-EOF && |
| 13 | + $(git rev-parse HEAD) |
| 14 | + ^$(git rev-parse HEAD~1) |
| 15 | + EOF |
| 16 | +
|
| 17 | + cat >in-big <<-EOF && |
| 18 | + $(git rev-parse HEAD) |
| 19 | + ^$(git rev-parse HEAD~1000) |
| 20 | + EOF |
| 21 | +
|
| 22 | + cat >in-shallow <<-EOF |
| 23 | + $(git rev-parse HEAD) |
| 24 | + --shallow $(git rev-parse HEAD) |
| 25 | + EOF |
| 26 | +' |
| 27 | + |
| 28 | +test_perf 'thin pack' ' |
| 29 | + git pack-objects --thin --stdout --revs --sparse <in-thin >out |
| 30 | +' |
| 31 | + |
| 32 | +test_size 'thin pack size' ' |
| 33 | + test_file_size out |
| 34 | +' |
| 35 | + |
| 36 | +test_perf 'thin pack with --full-name-hash' ' |
| 37 | + git pack-objects --thin --stdout --revs --sparse --full-name-hash <in-thin >out |
| 38 | +' |
| 39 | + |
| 40 | +test_size 'thin pack size with --full-name-hash' ' |
| 41 | + test_file_size out |
| 42 | +' |
| 43 | + |
| 44 | +test_perf 'big pack' ' |
| 45 | + git pack-objects --stdout --revs --sparse <in-big >out |
| 46 | +' |
| 47 | + |
| 48 | +test_size 'big pack size' ' |
| 49 | + test_file_size out |
| 50 | +' |
| 51 | + |
| 52 | +test_perf 'big pack with --full-name-hash' ' |
| 53 | + git pack-objects --stdout --revs --sparse --full-name-hash <in-big >out |
| 54 | +' |
| 55 | + |
| 56 | +test_size 'big pack size with --full-name-hash' ' |
| 57 | + test_file_size out |
| 58 | +' |
| 59 | + |
| 60 | +test_perf 'shallow fetch pack' ' |
| 61 | + git pack-objects --stdout --revs --sparse --shallow <in-shallow >out |
| 62 | +' |
| 63 | + |
| 64 | +test_size 'shallow pack size' ' |
| 65 | + test_file_size out |
| 66 | +' |
| 67 | + |
| 68 | +test_perf 'shallow pack with --full-name-hash' ' |
| 69 | + git pack-objects --stdout --revs --sparse --shallow --full-name-hash <in-shallow >out |
| 70 | +' |
| 71 | + |
| 72 | +test_size 'shallow pack size with --full-name-hash' ' |
| 73 | + test_file_size out |
| 74 | +' |
| 75 | + |
| 76 | +test_perf 'repack' ' |
| 77 | + git repack -adf |
| 78 | +' |
| 79 | + |
| 80 | +test_size 'repack size' ' |
| 81 | + pack=$(ls .git/objects/pack/pack-*.pack) && |
| 82 | + test_file_size "$pack" |
| 83 | +' |
| 84 | + |
| 85 | +test_perf 'repack with --full-name-hash' ' |
| 86 | + git repack -adf --full-name-hash |
| 87 | +' |
| 88 | + |
| 89 | +test_size 'repack size with --full-name-hash' ' |
| 90 | + pack=$(ls .git/objects/pack/pack-*.pack) && |
| 91 | + test_file_size "$pack" |
| 92 | +' |
| 93 | + |
| 94 | +test_done |
0 commit comments