diff options
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | docs/note-2021-10-08.md | 20 | ||||
-rw-r--r-- | exp/Makefile | 15 | ||||
-rwxr-xr-x | exp/exp.sh | 29 |
4 files changed, 59 insertions, 7 deletions
@@ -14,7 +14,7 @@ sur un support de stockage classique : le _repo_. | +---------+ +---------+ | +-----------+ | | | | | | | | | | Source |--------->| Repo |----------->| DNA-Drive | - | | | COMMIT | | | SYMTHESE | | + | | | COMMIT | | | SYNTHESE | | | +---------+ +---------+ | +-----------+ | | | Ordinateur | diff --git a/docs/note-2021-10-08.md b/docs/note-2021-10-08.md new file mode 100644 index 0000000..fc26758 --- /dev/null +++ b/docs/note-2021-10-08.md @@ -0,0 +1,20 @@ +Comparison with git basic +========================= + +``` +=============== SUMMARY =============== + dna_4k dna_8k diffs nopack + 85,062,292 77,288,903 59,771,518 83,421,168 + 113,976,574 108,519,248 75,958,096 126,395,519 + 40,450,844 43,371,572 87,905,291 62,515,404 + 13,699,644 17,821,696 7,398,260 47,162,686 + 39,029,362 40,321,219 28,806,094 55,473,207 + 9,335,530 11,047,234 20,915,481 32,021,383 + 16,891,778 20,219,859 12,926,085 42,470,711 + 9,764,957 11,381,646 13,592,417 28,181,096 + 2,597 131,258 1,395 55,764 + 93,015 243,287 104,610 2,739,143 + 9,331 7,919 2,607 102,283 +================ TOTAL ================ + 328,315,924 330,353,841 307,381,854 480,538,364 +``` diff --git a/exp/Makefile b/exp/Makefile index 8fb4ce0..4df2bb6 100644 --- a/exp/Makefile +++ b/exp/Makefile @@ -11,13 +11,15 @@ export COMMITS ?= commits export DNA_4K ?= dna_4k export DNA_8K ?= dna_8k export DIFFS ?= diffs +NOPACK ?= nopack +export GIT_NOPACK ?= $(abspath $(NOPACK)) export REPO_PATH ?= repo -GIT_PATH := git +export GIT_PATH ?= $(abspath git) GITC := git -C $(REPO_PATH) DNADIRS := $(DNA_4K) $(DNA_8K) -DATADIRS := $(DNA_4K) $(DNA_8K) $(DIFFS) +DATADIRS := $(DNA_4K) $(DNA_8K) $(DIFFS) $(NOPACK) SIZEFILES := $(DATADIRS:%=%.size) .PHONY: all exp @@ -39,7 +41,7 @@ summary.csv: $(SIZEFILES) echo $(DATADIRS) | tr ' ' ',' > $@ paste -d "," $^ >> $@ -$(DNADIRS:%=%.size): %.size: %.versions +$(DNADIRS:%=%.size) $(NOPACK).size: %.size: %.versions run rm -rf $@ for i in $</*; do \ cut -f1 $$i | paste -sd+ | bc >> $@; \ @@ -62,12 +64,12 @@ $(DNADIRS:%=%.size): %.size: %.versions | sort -k2 \ > $@ -run: $(COMMITS) $(DNA_BACKUP) | $(DATADIRS) +run: $(COMMITS) $(DNA_BACKUP) | $(DATADIRS) $(NOPACK).versions rm -rf $(DATADIRS:%=%/*) ./exp.sh touch $@ -$(DATADIRS): +$(DATADIRS) $(NOPACK).versions: mkdir $@ $(DNA_BACKUP): .FORCE @@ -89,7 +91,8 @@ clean: mostlyclean rm -f $(COMMITS) mostlyclean: resultsclean - rm -rf $(DATADIRS) $(DNADIRS:%=%.versions) run + rm -rf $(DATADIRS) $(DATADIRS:%=%.versions) + rm -f run $(DATADIRS:%=%.results) resultsclean: rm -f summary.csv $(SIZEFILES) @@ -3,19 +3,32 @@ # This script expects the following variables to be exported: # - DNA_BACKUP: the path to dna-backup binary # - REPO_PATH: the path of the repo the experiment is based on +# - GIT_PATH: the path of the repo git-dir # - MAX_VERSION: the max number for versions for the experiment # - COMMITS: the name of the file that contains the lists of versions # - DNA_4K: the path fo the dna-backup dir with 4K chunksize # - DNA_8K: the path fo the dna-backup dir with 8K chunksize # - DIFFS: the path of the git diff dir +# - GIT_NOPACK: the path of the git nopack dir log() { echo -e "\033[90m$(date +%T.%3N)\033[0m" $* } +set-git-dir() { + echo gitdir: $1 > $REPO_PATH/.git +} + GITC="git -C $REPO_PATH" OUT=/tmp/dna-backup-exp-out +# Init git nopack dir +rm $REPO_PATH/.git +$GITC init --separate-git-dir=$GIT_NOPACK +$GITC --git-dir=$GIT_NOPACK config gc.auto 0 +set-git-dir $GIT_PATH +nopack_prev=0 + # "empty tree" commit prev="4b825dc642cb6eb9a060e54bf8d69288fbee4904" last=$(tail --lines=1 $COMMITS | cut -f1) @@ -38,6 +51,22 @@ do | gzip \ > $diff + # Create git nopack for this version + log "create git nopack for this version" + set-git-dir $GIT_NOPACK + $GITC add . + $GITC commit -m $hash &> $OUT \ + || (log "error commiting to nopack"; cat $OUT; exit 1) + ls $GIT_NOPACK/objects/pack + find $GIT_NOPACK -type f -exec du -ba {} + \ + | grep -v /logs/ \ + | cut -f1 \ + | paste -sd+ \ + | xargs -i echo {} - $nopack_prev \ + | bc \ + > $(printf "%s.versions/%05d" $GIT_NOPACK $i) + set-git-dir $GIT_PATH + # Create 4k dna backup for this version log "create 4k dna backup for this version" $DNA_BACKUP commit -v 2 -c 4096 $REPO_PATH $DNA_4K |