4 ms·
Using a simple shell for-loop, I could create 10000 commits in 25 seconds (= 400 per second) with the code below. The 4.2 million commits should take around 3 h
by rav 5y ago
Using a simple shell for-loop, I could create 10000 commits in 25 seconds (= 400 per second) with the code below. The 4.2 million commits should take around 3 hours to create at this pace.
Looking at the most recent 10000 commits in the repository, it doesn't seem like the creator ever got more than 20 commits per second, which means it would take on the order of 60 hours for the creator to make this many commits.
$ git clone https://github.com/IThinkImOKAY/IThinkImOKAY && cd IThinkImOKAY
$ t=`git write-tree`
$ h=`git rev-parse @`
$ date; for i in `seq 1 10000`; do h=`echo lol|git commit-tree $t -p $h`; done; date
Wed Jun 9 05:20:11 PM CEST 2021
Wed Jun 9 05:20:36 PM CEST 2021
- rav 5y agoHere's a parallel implementation that gets me 950 commits per second: manycommits() { h=@; t=`git rev-parse @^{tree}` for i in `seq 2 "$1"`; do h=`echo "$*" | git commit-tree $t -p $h` done echo $h } twice() { "$@" a & "$@" b ; wait; } twice twice twice twice manycommits 10000 | while read h; do git merge --no-edit $h; done
- egwynn 5y agoAnd here I was thinking matching compensation to LOCs was silly. Clearly more employers need to pay based on commits per second!