From 8f709e50840190231273195612d2c6ed5d886cf6 Mon Sep 17 00:00:00 2001 From: eleonore12345 Date: Thu, 11 Jul 2024 11:58:38 +0200 Subject: [PATCH] avec des run partout --- performance_tests.sh | 573 +++++++++++++++++++++---------------------- 1 file changed, 286 insertions(+), 287 deletions(-) diff --git a/performance_tests.sh b/performance_tests.sh index cb90f4c..800f2dc 100755 --- a/performance_tests.sh +++ b/performance_tests.sh @@ -87,10 +87,10 @@ section "Tests on the initial populating of the repository" test0(){ section TEST0 echo "TEST 0: classic cloning." - git clone --recurse-submodules --progress --no-local $1 &> cloning_text - cd $REPO_NAME + run git clone --recurse-submodules --remote-submodules --progress --no-local $1 &> cloning_text + run cd $REPO_NAME run git submodule update --init --recursive --force --remote --progress &> /dev/null - cd .. + run cd .. get_storage_used "./$REPO_NAME" get_bandwidth cloning_text echo "memory usage: $mem" @@ -102,10 +102,10 @@ test0(){ test1(){ section TEST1 echo "TEST 1: --single-branch cloning." - git clone --recurse-submodules --progress --single-branch --no-local $1 &> cloning_text - cd $REPO_NAME + run git clone --recurse-submodules --remote-submodules --progress --single-branch --no-local $1 &> cloning_text + run cd $REPO_NAME run git submodule update --init --recursive --force --remote --progress &> /dev/null - cd .. + run cd .. get_storage_used ./$REPO_NAME get_bandwidth cloning_text echo "memory usage: $mem" @@ -117,10 +117,10 @@ test1(){ test2(){ section TEST2 echo "TEST 2: --depth=1 --no-single-branch" - git clone --recurse-submodules --progress --depth=1 --no-local --no-single-branch $1 &> cloning_text - cd $REPO_NAME + run git clone --recurse-submodules --remote-submodules --progress --depth=1 --no-local --no-single-branch $1 &> cloning_text + run cd $REPO_NAME run git submodule update --init --recursive --force --remote --progress --depth=1 --no-single-branch &> /dev/null - cd .. + run cd .. get_storage_used ./$REPO_NAME get_bandwidth cloning_text echo "memory usage: $mem" @@ -132,10 +132,10 @@ test2(){ test3(){ section TEST3 echo "TEST 3: --depth=1 with single-branch (default))" - git clone --recurse-submodules --progress --single-branch --no-local --depth=1 $1 &> cloning_text - cd $REPO_NAME + run git clone --recurse-submodules --remote-submodules --progress --single-branch --no-local --depth=1 $1 &> cloning_text + run cd $REPO_NAME run git submodule update --init --recursive --force --remote --progress --depth=1 &> /dev/null - cd .. + run cd .. get_storage_used ./$REPO_NAME get_bandwidth cloning_text echo "memory usage: $mem" @@ -147,11 +147,11 @@ test3(){ test4(){ section TEST4 echo "TEST 4: --depth=1 with single-branch (default) and reflog and gc" - git clone --recurse-submodules --progress --single-branch --no-local --depth=1 $1 &> cloning_text - cd $REPO_NAME + run git clone --recurse-submodules --remote-submodules --progress --single-branch --no-local --depth=1 $1 &> cloning_text + run cd $REPO_NAME run git submodule update --init --recursive --force --remote --progress --depth=1 &> /dev/null - git reset --hard - cd .. + run git reset --hard + run cd .. get_storage_used ./$REPO_NAME get_bandwidth cloning_text echo "memory usage: $mem" @@ -173,11 +173,11 @@ test5(){ run git remote add -f origin ../$1 &> /dev/null run git submodule update --init --recursive --force --depth=1 --remote &> /dev/null run git fetch --progress --tags --depth=1 --prune --prune-tags origin &> /dev/null - git checkout -f origin/main &> /dev/null + run git checkout -f origin/main &> /dev/null get_storage_used . echo "memory usage: $mem" echo "bandwidth usage (submodule excluded): unknown" - cd .. + run cd .. run rm -rf $REPO_NAME } @@ -187,87 +187,86 @@ test6(){ section TEST6 run echo 'TEST 6: after addition of a 1M file' #initialization - git clone --recurse-submodules --progress --depth=1 --no-local $1 &> /dev/null - cd $REPO_NAME - #run git submodule update --init --recursive --force --depth=1 + run git clone --recurse-submodules --remote-submodules --progress --depth=1 --no-local $1 &> /dev/null + run cd $REPO_NAME get_storage_used . mem_before=$mem #modification of the remote repo - cd ../$REMOTE + run cd ../$REMOTE create_random_file 'sample5' '1M' #adding a 1M file run git add sample5 run git commit --quiet -m"fourth 1M sample created" - cd ../../$REPO_NAME + run cd ../../$REPO_NAME #fetching run git submodule update --init --recursive --force --remote &> /dev/null run git fetch --progress --tags --prune --prune-tags origin &> /dev/null - git checkout -f origin/main &> /dev/null + run git checkout -f origin/main &> /dev/null get_storage_used . mem_after=$mem mem=$(($mem_after-$mem_before)) echo "memory usage: +$mem" - cd ../$REMOTE - git reset --hard -q HEAD~1 - cd ../.. - rm -rf performance_testing + run cd ../$REMOTE + run git reset --hard -q HEAD~1 + run cd ../.. + run rm -rf performance_testing } test7(){ section TEST7 run echo 'TEST 7: after removal of a 1M file' #initialization - git clone --recurse-submodules --progress --depth=1 --no-local $1 &> /dev/null - cd $REPO_NAME + run git clone --recurse-submodules --remote-submodules --progress --depth=1 --no-local $1 &> /dev/null + run cd $REPO_NAME get_storage_used . mem_before=$mem #modification of the remote repo - cd ../$REMOTE + run cd ../$REMOTE run rm sample0 run git add sample0 run git commit --quiet -m"1M sample0 deleted" - cd ../../$REPO_NAME + run cd ../../$REPO_NAME #fetching run git submodule update --init --recursive --force --remote &> /dev/null run git fetch --progress --tags --prune --prune-tags origin &> /dev/null - git checkout -f origin/main &> /dev/null + run git checkout -f origin/main &> /dev/null get_storage_used . mem_after=$mem mem=$(($mem_after-$mem_before)) echo "memory usage: $mem" - cd ../$REMOTE - git reset --hard -q HEAD~1 - git clean -df - cd ../.. - rm -rf performance_testing + run cd ../$REMOTE + run git reset --hard -q HEAD~1 + run git clean -df + run cd ../.. + run rm -rf performance_testing } test8(){ section TEST8 run echo 'TEST 8: after addition then removal of a 1M file' #initialization - git clone --recurse-submodules --progress --depth=1 --no-local $1 &> /dev/null - cd $REPO_NAME + run git clone --recurse-submodules --remote-submodules --progress --depth=1 --no-local $1 &> /dev/null + run cd $REPO_NAME get_storage_used . mem_before=$mem #modification of the remote repo - cd ../$REMOTE + run cd ../$REMOTE create_random_file 'sample5' '1M' #adding a 1M file run git add sample5 run git commit --quiet -m"fourth 1M sample created" run rm sample5 run git add sample5 run git commit --quiet -m"1M "sample5" deleted" - cd ../../$REPO_NAME + run cd ../../$REPO_NAME #fetching run git submodule update --init --recursive --force --remote &> /dev/null run git fetch --progress --tags --prune --prune-tags origin &> /dev/null - git checkout -f origin/main &> /dev/null + run git checkout -f origin/main &> /dev/null get_storage_used . mem_after=$mem mem=$(($mem_after-$mem_before)) echo "memory usage: $mem" - cd ../$REMOTE - git reset --hard -q HEAD~2 - cd ../.. - rm -rf performance_testing + run cd ../$REMOTE + run git reset --hard -q HEAD~2 + run cd ../.. + run rm -rf performance_testing } #fetching with --depth=1 @@ -275,83 +274,83 @@ test9(){ section TEST9 run echo 'TEST 9: after addition of a 1M file' #initialization - git clone --recurse-submodules --progress --depth=1 --no-local $1 &> /dev/null - cd $REPO_NAME + run git clone --recurse-submodules --remote-submodules --progress --depth=1 --no-local $1 &> /dev/null + run cd $REPO_NAME get_storage_used . mem_before=$mem #modification of the remote repo - cd ../$REMOTE + run cd ../$REMOTE create_random_file 'sample5' '1M' #adding a 1M file run git add sample5 run git commit --quiet -m"fourth 1M sample created" - cd ../../$REPO_NAME + run cd ../../$REPO_NAME run git submodule update --init --recursive --force --depth=1 --remote &> /dev/null run git fetch --progress --tags --depth=1 --prune --prune-tags origin &> /dev/null - git checkout -f origin/main &> /dev/null + run git checkout -f origin/main &> /dev/null get_storage_used . mem_after=$mem mem=$(($mem_after-$mem_before)) echo "memory usage: +$mem" - cd ../$REMOTE - git reset --hard -q HEAD~1 - cd ../.. - rm -rf performance_testing + run cd ../$REMOTE + run git reset --hard -q HEAD~1 + run cd ../.. + run rm -rf performance_testing } test10(){ section TEST10 run echo 'TEST 10: after removal of a 1M file' #initialization - git clone --recurse-submodules --progress --depth=1 --no-local $1 &> /dev/null - cd $REPO_NAME + run git clone --recurse-submodules --remote-submodules --progress --depth=1 --no-local $1 &> /dev/null + run cd $REPO_NAME get_storage_used . mem_before=$mem #modification of the remote repo - cd ../$REMOTE + run cd ../$REMOTE run rm sample0 run git add sample0 run git commit --quiet -m"1M sample0 deleted" - cd ../../$REPO_NAME + run cd ../../$REPO_NAME #fetching run git submodule update --init --recursive --force --depth=1 --remote &> /dev/null - git fetch --progress --tags --depth=1 --prune --prune-tags origin &> /dev/null - git checkout -f origin/main &> /dev/null + run git fetch --progress --tags --depth=1 --prune --prune-tags origin &> /dev/null + run git checkout -f origin/main &> /dev/null get_storage_used . mem_after=$mem mem=$(($mem_after-$mem_before)) echo "memory usage: $mem" - cd ../$REMOTE + run cd ../$REMOTE git reset --hard -q HEAD~1 - cd ../.. - rm -rf performance_testing + run cd ../.. + run rm -rf performance_testing } test11(){ section TEST11 run echo 'TEST 11: after addition then removal of a 1M file' - git clone --recurse-submodules --progress --depth=1 --no-local $1 &> /dev/null - cd $REPO_NAME + run git clone --recurse-submodules --remote-submodules --progress --depth=1 --no-local $1 &> /dev/null + run cd $REPO_NAME get_storage_used . mem_before=$mem #modification of the remote repo - cd ../$REMOTE + run cd ../$REMOTE create_random_file 'sample5' '1M' #adding a 1M file run git add sample5 run git commit --quiet -m"fourth 1M sample created" run rm sample5 run git add sample5 run git commit --quiet -m"1M "sample5" deleted" - cd ../../$REPO_NAME + run cd ../../$REPO_NAME #fetching run git submodule update --init --recursive --force --depth=1 --remote &> /dev/null run git fetch --progress --tags --depth=1 --prune --prune-tags origin &> /dev/null - git checkout -f origin/main &> /dev/null + run git checkout -f origin/main &> /dev/null get_storage_used . mem_after=$mem mem=$(($mem_after-$mem_before)) echo "memory usage: $mem" - cd ../$REMOTE - git reset --hard -q HEAD~2 - cd ../.. - rm -rf performance_testing + run cd ../$REMOTE + run git reset --hard -q HEAD~2 + run cd ../.. + run rm -rf performance_testing } # --depth=1 fetching with reflog and gc @@ -359,89 +358,89 @@ test12(){ section TEST12 run echo 'TEST 12: after addition of a 1M file' #initialization - git clone --recurse-submodules --progress --depth=1 --no-local $1 &> /dev/null - cd $REPO_NAME + run git clone --recurse-submodules --remote-submodules --progress --depth=1 --no-local $1 &> /dev/null + run cd $REPO_NAME get_storage_used . mem_before=$mem #modification of the remote repo - cd ../$REMOTE + run cd ../$REMOTE create_random_file 'sample5' '1M' #adding a 1M file run git add sample5 run git commit --quiet -m"fourth 1M sample created" - cd ../../$REPO_NAME + run cd ../../$REPO_NAME run git submodule update --init --recursive --force --depth=1 --remote &> /dev/null run git fetch --progress --tags --depth=1 --prune --prune-tags origin &> /dev/null - git checkout -f origin/main &> /dev/null - git reflog expire --expire=now --all &> /dev/null - git gc --aggressive --prune=now &> /dev/null + run git checkout -f origin/main &> /dev/null + run git reflog expire --expire=now --all &> /dev/null + run git gc --aggressive --prune=now &> /dev/null get_storage_used . mem_after=$mem mem=$(($mem_after-$mem_before)) echo "memory usage: +$mem" - cd ../$REMOTE - git reset --hard -q HEAD~1 - cd ../.. - rm -rf performance_testing + run cd ../$REMOTE + run git reset --hard -q HEAD~1 + run cd ../.. + run rm -rf performance_testing } test13(){ section TEST13 run echo 'TEST 13: after removal of a 1M file' #initialization - git clone --recurse-submodules --progress --depth=1 --no-local $1 &> /dev/null - cd $REPO_NAME + run git clone --recurse-submodules --remote-submodules --progress --depth=1 --no-local $1 &> /dev/null + run cd $REPO_NAME get_storage_used . mem_before=$mem #modification of the remote repo - cd ../$REMOTE + run cd ../$REMOTE run rm sample0 run git add sample0 run git commit --quiet -m"1M sample0 deleted" - cd ../../$REPO_NAME + run cd ../../$REPO_NAME #fetching run git submodule update --init --recursive --force --depth=1 --remote &> /dev/null - git fetch --progress --tags --depth=1 --prune --prune-tags origin &> /dev/null - git checkout -f origin/main &> /dev/null - git reflog expire --expire=now --all &> /dev/null - git gc --aggressive --prune=now &> /dev/null + run git fetch --progress --tags --depth=1 --prune --prune-tags origin &> /dev/null + run git checkout -f origin/main &> /dev/null + run git reflog expire --expire=now --all &> /dev/null + run git gc --aggressive --prune=now &> /dev/null get_storage_used . mem_after=$mem mem=$(($mem_after-$mem_before)) echo "memory usage: $mem" - cd ../$REMOTE - git reset --hard -q HEAD~1 - cd ../.. - rm -rf performance_testing + run cd ../$REMOTE + run git reset --hard -q HEAD~1 + run cd ../.. + run rm -rf performance_testing } test14(){ section TEST14 run echo 'TEST 14: after addition then removal of a 1M file' - git clone --recurse-submodules --progress --depth=1 --no-local $1 &> /dev/null - cd $REPO_NAME + run git clone --recurse-submodules --remote-submodules --progress --depth=1 --no-local $1 &> /dev/null + run cd $REPO_NAME get_storage_used . mem_before=$mem #modification of the remote repo - cd ../$REMOTE + run cd ../$REMOTE create_random_file 'sample5' '1M' #adding a 1M file run git add sample5 run git commit --quiet -m"fourth 1M sample created" run rm sample5 run git add sample5 run git commit --quiet -m"1M "sample5" deleted" - cd ../../$REPO_NAME + run cd ../../$REPO_NAME #fetching run git submodule update --init --recursive --force --depth=1 --remote &> /dev/null run git fetch --progress --tags --depth=1 --prune --prune-tags origin &> /dev/null - git checkout -f origin/main &> /dev/null - git reflog expire --expire=now --all &> /dev/null - git gc --aggressive --prune=now &> /dev/null + run git checkout -f origin/main &> /dev/null + run git reflog expire --expire=now --all &> /dev/null + run git gc --aggressive --prune=now &> /dev/null get_storage_used . mem_after=$mem mem=$(($mem_after-$mem_before)) echo "memory usage: $mem" - cd ../$REMOTE - git reset --hard -q HEAD~2 - cd ../.. - rm -rf performance_testing + run cd ../$REMOTE + run git reset --hard -q HEAD~2 + run cd ../.. + run rm -rf performance_testing } #--depth=1 fetching with reset --hard @@ -449,201 +448,201 @@ test15(){ section TEST15 run echo 'TEST 15: after addition of a 1M file' #initialization - git clone --recurse-submodules --progress --depth=1 --no-local $1 &> /dev/null - cd $REPO_NAME + run git clone --recurse-submodules --remote-submodules --progress --depth=1 --no-local $1 &> /dev/null + run cd $REPO_NAME get_storage_used . mem_before=$mem #modification of the remote repo - cd ../$REMOTE + run cd ../$REMOTE create_random_file 'sample5' '1M' #adding a 1M file run git add sample5 run git commit --quiet -m"fourth 1M sample created" - cd ../../$REPO_NAME + run cd ../../$REPO_NAME run git submodule update --init --recursive --force --depth=1 --remote &> /dev/null run git fetch --progress --tags --depth=1 --prune --prune-tags origin &> /dev/null - git reset --hard origin/main &> /dev/null + run git reset --hard origin/main &> /dev/null get_storage_used . mem_after=$mem mem=$(($mem_after-$mem_before)) echo "memory usage: +$mem" - cd ../$REMOTE - git reset --hard -q HEAD~1 - cd ../.. - rm -rf performance_testing + run cd ../$REMOTE + run git reset --hard -q HEAD~1 + run cd ../.. + run rm -rf performance_testing } test16(){ section TEST16 run echo 'TEST 16: after removal of a 1M file' #initialization - git clone --recurse-submodules --progress --depth=1 --no-local $1 &> /dev/null - cd $REPO_NAME + run git clone --recurse-submodules --remote-submodules --progress --depth=1 --no-local $1 &> /dev/null + run cd $REPO_NAME get_storage_used . mem_before=$mem #modification of the remote repo - cd ../$REMOTE + run cd ../$REMOTE run rm sample0 run git add sample0 run git commit --quiet -m"1M sample0 deleted" - cd ../../$REPO_NAME + run cd ../../$REPO_NAME #fetching run git submodule update --init --recursive --force --depth=1 --remote &> /dev/null - git fetch --progress --tags --depth=1 --prune --prune-tags origin &> /dev/null - git reset --hard origin/main &> /dev/null + run git fetch --progress --tags --depth=1 --prune --prune-tags origin &> /dev/null + run git reset --hard origin/main &> /dev/null get_storage_used . mem_after=$mem mem=$(($mem_after-$mem_before)) echo "memory usage: $mem" - cd ../$REMOTE - git reset --hard -q HEAD~1 - cd ../.. - rm -rf performance_testing + run cd ../$REMOTE + run git reset --hard -q HEAD~1 + run cd ../.. + run rm -rf performance_testing } test17(){ section TEST17 run echo 'TEST 17: after addition then removal of a 1M file' - git clone --recurse-submodules --progress --depth=1 --no-local $1 &> /dev/null - cd $REPO_NAME + run git clone --recurse-submodules --remote-submodules --progress --depth=1 --no-local $1 &> /dev/null + run cd $REPO_NAME get_storage_used . mem_before=$mem #modification of the remote repo - cd ../$REMOTE + run cd ../$REMOTE create_random_file 'sample5' '1M' #adding a 1M file run git add sample5 run git commit --quiet -m"fourth 1M sample created" run rm sample5 run git add sample5 run git commit --quiet -m"1M "sample5" deleted" - cd ../../$REPO_NAME + run cd ../../$REPO_NAME #fetching run git submodule update --init --recursive --force --depth=1 --remote &> /dev/null run git fetch --progress --tags --depth=1 --prune --prune-tags origin &> /dev/null - git reset --hard origin/main &> /dev/null + run git reset --hard origin/main &> /dev/null get_storage_used . mem_after=$mem mem=$(($mem_after-$mem_before)) echo "memory usage: $mem" - cd ../$REMOTE - git reset --hard -q HEAD~2 - cd ../.. - rm -rf performance_testing + run cd ../$REMOTE + run git reset --hard -q HEAD~2 + run cd ../.. + run rm -rf performance_testing } #--depth=1 fetching with reset --hard and reflog and gc test18(){ section TEST18 run echo 'TEST 18: after addition of a 1M file' - git clone --recurse-submodules --progress --depth=1 --no-local $1 &> /dev/null - cd $REPO_NAME + run git clone --recurse-submodules --remote-submodules --progress --depth=1 --no-local $1 &> /dev/null + run cd $REPO_NAME get_storage_used . mem_before=$mem #modification of the remote repo - cd ../$REMOTE + run cd ../$REMOTE create_random_file 'sample5' '1M' #adding a 1M file run git add sample5 run git commit --quiet -m"fourth 1M sample created" - cd ../../$REPO_NAME + run cd ../../$REPO_NAME #fetching run git submodule update --init --recursive --force --depth=1 --remote &> /dev/null run git fetch --progress --tags --depth=1 --prune --prune-tags origin &> /dev/null - git reset --hard origin/main &> /dev/null - git reflog expire --expire=now --all &> /dev/null - git gc --aggressive --prune=now &> /dev/null + run git reset --hard origin/main &> /dev/null + run git reflog expire --expire=now --all &> /dev/null + run git gc --aggressive --prune=now &> /dev/null get_storage_used . mem_after=$mem mem=$(($mem_after-$mem_before)) echo "memory usage: $mem" - cd ../$REMOTE - git reset --hard -q HEAD~1 - cd ../.. - rm -rf performance_testing + run cd ../$REMOTE + run git reset --hard -q HEAD~1 + run cd ../.. + run rm -rf performance_testing } test19(){ section TEST19 run echo 'TEST 19: after removal of a 1M file' #initialization - git clone --recurse-submodules --progress --depth=1 --no-local $1 &> /dev/null - cd $REPO_NAME + run git clone --recurse-submodules --remote-submodules --progress --depth=1 --no-local $1 &> /dev/null + run cd $REPO_NAME get_storage_used . mem_before=$mem #modification of the remote repo - cd ../$REMOTE + run cd ../$REMOTE run rm sample0 run git add sample0 run git commit --quiet -m"1M sample0 deleted" - cd ../../$REPO_NAME + run cd ../../$REPO_NAME #fetching run git submodule update --init --recursive --force --depth=1 --remote &> /dev/null - git fetch --progress --tags --depth=1 --prune --prune-tags origin &> /dev/null - git reset --hard origin/main &> /dev/null - git reflog expire --expire=now --all &> /dev/null - git gc --aggressive --prune=now &> /dev/null + run git fetch --progress --tags --depth=1 --prune --prune-tags origin &> /dev/null + run git reset --hard origin/main &> /dev/null + run git reflog expire --expire=now --all &> /dev/null + run git gc --aggressive --prune=now &> /dev/null get_storage_used . mem_after=$mem mem=$(($mem_after-$mem_before)) echo "memory usage: $mem" - cd ../$REMOTE - git reset --hard -q HEAD~1 - cd ../.. - rm -rf performance_testing + run cd ../$REMOTE + run git reset --hard -q HEAD~1 + run cd ../.. + run rm -rf performance_testing } test20(){ section TEST20 run echo 'TEST 20: after addition then removal of a 1M file' - git clone --recurse-submodules --progress --depth=1 --no-local $1 &> /dev/null - cd $REPO_NAME + run git clone --recurse-submodules --remote-submodules --progress --depth=1 --no-local $1 &> /dev/null + run cd $REPO_NAME get_storage_used . mem_before=$mem #modification of the remote repo - cd ../$REMOTE + run cd ../$REMOTE create_random_file 'sample5' '1M' #adding a 1M file run git add sample5 run git commit --quiet -m"fourth 1M sample created" run rm sample5 run git add sample5 run git commit --quiet -m"1M "sample5" deleted" - cd ../../$REPO_NAME + run cd ../../$REPO_NAME #fetching run git submodule update --init --recursive --force --depth=1 --remote &> /dev/null run git fetch --progress --tags --depth=1 --prune --prune-tags origin &> /dev/null - git reset --hard origin/main &> /dev/null - git reflog expire --expire=now --all &> /dev/null - git gc --aggressive --prune=now &> /dev/null + run git reset --hard origin/main &> /dev/null + run git reflog expire --expire=now --all &> /dev/null + run git gc --aggressive --prune=now &> /dev/null get_storage_used . mem_after=$mem mem=$(($mem_after-$mem_before)) echo "memory usage: $mem" - cd ../$REMOTE - git reset --hard -q HEAD~2 - cd ../.. - rm -rf performance_testing + run cd ../$REMOTE + run git reset --hard -q HEAD~2 + run cd ../.. + run rm -rf performance_testing } #--depth=1 fetching after modification applied in submodule test21(){ section TEST21 run echo 'TEST 21: after addition of a 1M file' if [ "$WITH_SUBMODULE" = "true" ]; then - git clone --recurse-submodules --progress --depth=1 --no-local $1 &> /dev/null - cd $REPO_NAME + run git clone --recurse-submodules --remote-submodules --progress --depth=1 --no-local $1 &> /dev/null + run cd $REPO_NAME get_storage_used . mem_before=$mem #modification of the remote submodule - cd .. - cd $REPO_PATH/$SUB_NAME + run cd .. + run cd $REPO_PATH/$SUB_NAME create_random_file 'sub_sample1' '1M' - git add sub_sample1 - git commit --quiet -m"second 1M sample created" - cd ../../$REPO_NAME + run git add sub_sample1 + run git commit --quiet -m"second 1M sample created" + run cd ../../$REPO_NAME #fetching run git submodule update --init --recursive --force --depth=1 --remote &> /dev/null run git fetch --progress --tags --depth=1 --prune --prune-tags origin &> /dev/null - git checkout -f origin/main &> /dev/null + run git checkout -f origin/main &> /dev/null get_storage_used . mem_after=$mem mem=$(($mem_after-$mem_before)) echo "memory usage: $mem" - cd ../$REPO_PATH/$SUB_NAME - git reset --hard -q HEAD~1 - cd ../.. - rm -rf performance_testing + run cd ../$REPO_PATH/$SUB_NAME + run git reset --hard -q HEAD~1 + run cd ../.. + run rm -rf performance_testing else echo "This test will not be performed because we are in no-submodule mode. Change boolean \$WITH_SUBMODULE to switch." fi @@ -653,17 +652,17 @@ test22(){ section TEST22 run echo 'TEST 22: after removal of a 1M file' if [ "$WITH_SUBMODULE" = "true" ]; then - git clone --recurse-submodules --progress --depth=1 --no-local $1 &> /dev/null - cd $REPO_NAME + run git clone --recurse-submodules --remote-submodules --progress --depth=1 --no-local $1 &> /dev/null + run cd $REPO_NAME get_storage_used . mem_before=$mem #modification of the remote submodule - cd .. - cd $REPO_PATH/$SUB_NAME + run cd .. + run cd $REPO_PATH/$SUB_NAME rm sub_sample0 - git add sub_sample0 - git commit --quiet -m"1M 'sub_sample0' deleted" - cd ../../$REPO_NAME + run git add sub_sample0 + run git commit --quiet -m"1M 'sub_sample0' deleted" + run cd ../../$REPO_NAME #fetching run git submodule update --init --recursive --force --depth=1 --remote &> /dev/null run git fetch --progress --tags --depth=1 --prune --prune-tags origin &> /dev/null @@ -672,10 +671,10 @@ test22(){ mem_after=$mem mem=$(($mem_after-$mem_before)) echo "memory usage: $mem" - cd ../$REPO_PATH/$SUB_NAME - git reset --hard -q HEAD~1 - cd ../.. - rm -rf performance_testing + run cd ../$REPO_PATH/$SUB_NAME + run git reset --hard -q HEAD~1 + run cd ../.. + run rm -rf performance_testing else echo "This test will not be performed because we are in no-submodule mode. Change boolean \$WITH_SUBMODULE to switch." fi @@ -685,32 +684,32 @@ test23(){ section TEST23 run echo 'TEST 23: after addition then removal of a 1M file' if [ "$WITH_SUBMODULE" = "true" ]; then - git clone --recurse-submodules --progress --depth=1 --no-local $1 &> /dev/null - cd $REPO_NAME + run git clone --recurse-submodules --remote-submodules --progress --depth=1 --no-local $1 &> /dev/null + run cd $REPO_NAME get_storage_used . mem_before=$mem #modification of the remote submodule - cd .. - cd $REPO_PATH/$SUB_NAME + run cd .. + run cd $REPO_PATH/$SUB_NAME create_random_file 'sub_sample1' '1M' - git add sub_sample1 - git commit --quiet -m"second 1M sample created" + run git add sub_sample1 + run git commit --quiet -m"second 1M sample created" rm sub_sample1 - git add sub_sample1 - git commit --quiet -m"1M 'sub_sample1' deleted" - cd ../../$REPO_NAME + run git add sub_sample1 + run git commit --quiet -m"1M 'sub_sample1' deleted" + run cd ../../$REPO_NAME #fetching run git submodule update --init --recursive --force --depth=1 --remote &> /dev/null run git fetch --progress --tags --depth=1 --prune --prune-tags origin &> /dev/null - git checkout -f origin/main &> /dev/null + run git checkout -f origin/main &> /dev/null get_storage_used . mem_after=$mem mem=$(($mem_after-$mem_before)) echo "memory usage: $mem" - cd ../$REPO_PATH/$SUB_NAME - git reset --hard -q HEAD~2 - cd ../.. - rm -rf performance_testing + run cd ../$REPO_PATH/$SUB_NAME + run git reset --hard -q HEAD~2 + run cd ../.. + run rm -rf performance_testing else echo "This test will not be performed because we are in no-submodule mode. Change boolean \$WITH_SUBMODULE to switch." fi @@ -721,89 +720,89 @@ test24(){ section TEST24 run echo 'TEST 24: after addition of a 1M file' #initialization - git clone --recurse-submodules --progress --depth=1 --no-local $1 &> /dev/null - cd $REPO_NAME + run git clone --recurse-submodules --remote-submodules --progress --depth=1 --no-local $1 &> /dev/null + run cd $REPO_NAME get_storage_used . mem_before=$mem #modification of the remote repo - cd ../$REMOTE + run cd ../$REMOTE create_random_file 'sample5' '1M' #adding a 1M file run git add sample5 run git commit --quiet -m"fourth 1M sample created" - cd ../../$REPO_NAME + run cd ../../$REPO_NAME run git submodule update --init --recursive --force --depth=1 --remote &> /dev/null run git fetch --progress --tags --depth=1 --prune --prune-tags origin &> /dev/null - git merge -X theirs --allow-unrelated-histories &> /dev/null - git reflog expire --expire=now --all &> /dev/null - git gc --aggressive --prune=now &> /dev/null + run git merge -X theirs --allow-unrelated-histories &> /dev/null + run git reflog expire --expire=now --all &> /dev/null + run git gc --aggressive --prune=now &> /dev/null get_storage_used . mem_after=$mem mem=$(($mem_after-$mem_before)) echo "memory usage: +$mem" - cd ../$REMOTE - git reset --hard -q HEAD~1 - cd ../.. - rm -rf performance_testing + run cd ../$REMOTE + run git reset --hard -q HEAD~1 + run cd ../.. + run rm -rf performance_testing } test25(){ section TEST25 run echo 'TEST 25: after removal of a 1M file' #initialization - git clone --recurse-submodules --progress --depth=1 --no-local $1 &> /dev/null - cd $REPO_NAME + run git clone --recurse-submodules --remote-submodules --progress --depth=1 --no-local $1 &> /dev/null + run cd $REPO_NAME get_storage_used . mem_before=$mem #modification of the remote repo - cd ../$REMOTE + run cd ../$REMOTE run rm sample0 run git add sample0 run git commit --quiet -m"1M sample0 deleted" - cd ../../$REPO_NAME + run cd ../../$REPO_NAME #fetching run git submodule update --init --recursive --force --depth=1 --remote &> /dev/null - git fetch --progress --tags --depth=1 --prune --prune-tags origin &> /dev/null - git merge -X theirs --allow-unrelated-histories &> /dev/null - git reflog expire --expire=now --all &> /dev/null - git gc --aggressive --prune=now &> /dev/null + run git fetch --progress --tags --depth=1 --prune --prune-tags origin &> /dev/null + run git merge -X theirs --allow-unrelated-histories &> /dev/null + run git reflog expire --expire=now --all &> /dev/null + run git gc --aggressive --prune=now &> /dev/null get_storage_used . mem_after=$mem mem=$(($mem_after-$mem_before)) echo "memory usage: $mem" - cd ../$REMOTE - git reset --hard -q HEAD~1 - cd ../.. - rm -rf performance_testing + run cd ../$REMOTE + run git reset --hard -q HEAD~1 + run cd ../.. + run rm -rf performance_testing } test26(){ section TEST26 run echo 'TEST 26: after addition then removal of a 1M file' - git clone --recurse-submodules --progress --depth=1 --no-local $1 &> /dev/null - cd $REPO_NAME + run git clone --recurse-submodules --remote-submodules --progress --depth=1 --no-local $1 &> /dev/null + run cd $REPO_NAME get_storage_used . mem_before=$mem #modification of the remote repo - cd ../$REMOTE + run cd ../$REMOTE create_random_file 'sample5' '1M' #adding a 1M file run git add sample5 run git commit --quiet -m"fourth 1M sample created" run rm sample5 run git add sample5 run git commit --quiet -m"1M "sample5" deleted" - cd ../../$REPO_NAME + run cd ../../$REPO_NAME #fetching run git submodule update --init --recursive --force --depth=1 --remote &> /dev/null run git fetch --progress --tags --depth=1 --prune --prune-tags origin &> /dev/null - git merge -X theirs --allow-unrelated-histories &> /dev/null - git reflog expire --expire=now --all &> /dev/null - git gc --aggressive --prune=now &> /dev/null + run git merge -X theirs --allow-unrelated-histories &> /dev/null + run git reflog expire --expire=now --all &> /dev/null + run git gc --aggressive --prune=now &> /dev/null get_storage_used . mem_after=$mem mem=$(($mem_after-$mem_before)) echo "memory usage: $mem" - cd ../$REMOTE - git reset --hard -q HEAD~2 - cd ../.. - rm -rf performance_testing + run cd ../$REMOTE + run git reset --hard -q HEAD~2 + run cd ../.. + run rm -rf performance_testing } # --depth=1 fetching+merging -s ours with reflog and gc @@ -811,101 +810,101 @@ test27(){ section TEST27 run echo 'TEST 27: after addition of a 1M file' #initialization - git clone --recurse-submodules --progress --depth=1 --no-local $1 &> /dev/null - cd $REPO_NAME + run git clone --recurse-submodules --remote-submodules --progress --depth=1 --no-local $1 &> /dev/null + run cd $REPO_NAME get_storage_used . mem_before=$mem #modification of the remote repo - cd ../$REMOTE + run cd ../$REMOTE create_random_file 'sample5' '1M' #adding a 1M file run git add sample5 run git commit --quiet -m"fourth 1M sample created" - cd ../../$REPO_NAME + run cd ../../$REPO_NAME run git submodule update --init --recursive --force --depth=1 --remote &> /dev/null run git fetch --progress --tags --depth=1 --prune --prune-tags origin &> /dev/null - git switch -c temp origin/main &> /dev/null #creating a temporary branch identical to origin/main - git merge -s ours --allow-unrelated-histories main &> /dev/null - git checkout main &> /dev/null - git merge --allow-unrelated-histories temp &> /dev/null - git branch -D temp &> /dev/null - git reflog expire --expire=now --all &> /dev/null - git gc --aggressive --prune=now &> /dev/null + run git switch -c temp origin/main &> /dev/null #creating a temporary branch identical to origin/main + run git merge -s ours --allow-unrelated-histories main &> /dev/null + run git checkout main &> /dev/null + run git merge --allow-unrelated-histories temp &> /dev/null + run git branch -D temp &> /dev/null + run git reflog expire --expire=now --all &> /dev/null + run git gc --aggressive --prune=now &> /dev/null get_storage_used . mem_after=$mem mem=$(($mem_after-$mem_before)) echo "memory usage: +$mem" - cd ../$REMOTE - git reset --hard -q HEAD~1 - cd ../.. - rm -rf performance_testing + run cd ../$REMOTE + run git reset --hard -q HEAD~1 + run cd ../.. + run rm -rf performance_testing } test28(){ section TEST28 run echo 'TEST 28: after removal of a 1M file' #initialization - git clone --recurse-submodules --progress --depth=1 --no-local $1 &> /dev/null - cd $REPO_NAME + run git clone --recurse-submodules --remote-submodules --progress --depth=1 --no-local $1 &> /dev/null + run cd $REPO_NAME get_storage_used . mem_before=$mem #modification of the remote repo - cd ../$REMOTE + run cd ../$REMOTE run rm sample0 run git add sample0 run git commit --quiet -m"1M sample0 deleted" - cd ../../$REPO_NAME + run cd ../../$REPO_NAME #fetching run git submodule update --init --recursive --force --depth=1 --remote &> /dev/null - git fetch --progress --tags --depth=1 --prune --prune-tags origin &> /dev/null - git switch -c temp origin/main &> /dev/null #creating a temporary branch identical to origin/main - git merge -s ours --allow-unrelated-histories main &> /dev/null - git checkout main &> /dev/null - git merge --allow-unrelated-histories temp &> /dev/null - git branch -D temp &> /dev/null - git reflog expire --expire=now --all &> /dev/null - git gc --aggressive --prune=now &> /dev/null + run git fetch --progress --tags --depth=1 --prune --prune-tags origin &> /dev/null + run git switch -c temp origin/main &> /dev/null #creating a temporary branch identical to origin/main + run git merge -s ours --allow-unrelated-histories main &> /dev/null + run git checkout main &> /dev/null + run git merge --allow-unrelated-histories temp &> /dev/null + run git branch -D temp &> /dev/null + run git reflog expire --expire=now --all &> /dev/null + run git gc --aggressive --prune=now &> /dev/null get_storage_used . mem_after=$mem mem=$(($mem_after-$mem_before)) echo "memory usage: $mem" - cd ../$REMOTE - git reset --hard -q HEAD~1 - cd ../.. - rm -rf performance_testing + run cd ../$REMOTE + run git reset --hard -q HEAD~1 + run cd ../.. + run rm -rf performance_testing } test29(){ section TEST29 run echo 'TEST 29: after addition then removal of a 1M file' - git clone --recurse-submodules --progress --depth=1 --no-local $1 &> /dev/null - cd $REPO_NAME + run git clone --recurse-submodules --remote-submodules --progress --depth=1 --no-local $1 &> /dev/null + run cd $REPO_NAME get_storage_used . mem_before=$mem #modification of the remote repo - cd ../$REMOTE + run cd ../$REMOTE create_random_file 'sample5' '1M' #adding a 1M file run git add sample5 run git commit --quiet -m"fourth 1M sample created" run rm sample5 run git add sample5 run git commit --quiet -m"1M "sample5" deleted" - cd ../../$REPO_NAME + run cd ../../$REPO_NAME #fetching run git submodule update --init --recursive --force --depth=1 --remote &> /dev/null run git fetch --progress --tags --depth=1 --prune --prune-tags origin &> /dev/null - git switch -c temp origin/main &> /dev/null #creating a temporary branch identical to origin/main - git merge -s ours --allow-unrelated-histories main &> /dev/null - git checkout main &> /dev/null - #git merge --allow-unrelated-histories temp &> /dev/null - git branch -D temp &> /dev/null - git reflog expire --expire=now --all &> /dev/null - git gc --aggressive --prune=now &> /dev/null + run git switch -c temp origin/main &> /dev/null #creating a temporary branch identical to origin/main + run git merge -s ours --allow-unrelated-histories main &> /dev/null + run git checkout main &> /dev/null + #run git merge --allow-unrelated-histories temp &> /dev/null + run git branch -D temp &> /dev/null + run git reflog expire --expire=now --all &> /dev/null + run git gc --aggressive --prune=now &> /dev/null get_storage_used . mem_after=$mem mem=$(($mem_after-$mem_before)) echo "memory usage: $mem" - cd ../$REMOTE - git reset --hard -q HEAD~2 - cd ../.. - rm -rf performance_testing + run cd ../$REMOTE + run git reset --hard -q HEAD~2 + run cd ../.. + run rm -rf performance_testing }