t / perf / p5310-pack-bitmaps.shon commit Merge branch 'jc/apply-ignore-whitespace' into maint (c122c9a)
   1#!/bin/sh
   2
   3test_description='Tests pack performance using bitmaps'
   4. ./perf-lib.sh
   5
   6test_perf_large_repo
   7
   8# note that we do everything through config,
   9# since we want to be able to compare bitmap-aware
  10# git versus non-bitmap git
  11test_expect_success 'setup bitmap config' '
  12        git config pack.writebitmaps true &&
  13        git config pack.writebitmaphashcache true
  14'
  15
  16test_perf 'repack to disk' '
  17        git repack -ad
  18'
  19
  20test_perf 'simulated clone' '
  21        git pack-objects --stdout --all </dev/null >/dev/null
  22'
  23
  24test_perf 'simulated fetch' '
  25        have=$(git rev-list HEAD~100 -1) &&
  26        {
  27                echo HEAD &&
  28                echo ^$have
  29        } | git pack-objects --revs --stdout >/dev/null
  30'
  31
  32test_expect_success 'create partial bitmap state' '
  33        # pick a commit to represent the repo tip in the past
  34        cutoff=$(git rev-list HEAD~100 -1) &&
  35        orig_tip=$(git rev-parse HEAD) &&
  36
  37        # now kill off all of the refs and pretend we had
  38        # just the one tip
  39        rm -rf .git/logs .git/refs/* .git/packed-refs
  40        git update-ref HEAD $cutoff
  41
  42        # and then repack, which will leave us with a nice
  43        # big bitmap pack of the "old" history, and all of
  44        # the new history will be loose, as if it had been pushed
  45        # up incrementally and exploded via unpack-objects
  46        git repack -Ad
  47
  48        # and now restore our original tip, as if the pushes
  49        # had happened
  50        git update-ref HEAD $orig_tip
  51'
  52
  53test_perf 'partial bitmap' '
  54        git pack-objects --stdout --all </dev/null >/dev/null
  55'
  56
  57test_done