diff options
author | René Scharfe <l.s.r@web.de> | 2018-10-04 17:13:06 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-10-04 11:12:13 -0700 |
commit | 8b2f8cbcb16b1a9775214fe1d69aeb1580ae179d (patch) | |
tree | 4b53010729a0740a6a09d614d3dafe8ace095063 /t/t5515/fetch.br-remote-glob_remote-glob | |
parent | khash: factor out kh_release_* (diff) | |
download | tgif-8b2f8cbcb16b1a9775214fe1d69aeb1580ae179d.tar.xz |
oidset: use khash
Reimplement oidset using khash.h in order to reduce its memory footprint
and make it faster.
Performance of a command that mainly checks for duplicate objects using
an oidset, with master and Clang 6.0.1:
$ cmd="./git-cat-file --batch-all-objects --unordered --buffer --batch-check='%(objectname)'"
$ /usr/bin/time $cmd >/dev/null
0.22user 0.03system 0:00.25elapsed 99%CPU (0avgtext+0avgdata 48484maxresident)k
0inputs+0outputs (0major+11204minor)pagefaults 0swaps
$ hyperfine "$cmd"
Benchmark #1: ./git-cat-file --batch-all-objects --unordered --buffer --batch-check='%(objectname)'
Time (mean ± σ): 250.0 ms ± 6.0 ms [User: 225.9 ms, System: 23.6 ms]
Range (min … max): 242.0 ms … 261.1 ms
And with this patch:
$ /usr/bin/time $cmd >/dev/null
0.14user 0.00system 0:00.15elapsed 100%CPU (0avgtext+0avgdata 41396maxresident)k
0inputs+0outputs (0major+8318minor)pagefaults 0swaps
$ hyperfine "$cmd"
Benchmark #1: ./git-cat-file --batch-all-objects --unordered --buffer --batch-check='%(objectname)'
Time (mean ± σ): 151.9 ms ± 4.9 ms [User: 130.5 ms, System: 21.2 ms]
Range (min … max): 148.2 ms … 170.4 ms
Initial-patch-by: Jeff King <peff@peff.net>
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5515/fetch.br-remote-glob_remote-glob')
0 files changed, 0 insertions, 0 deletions