summaryrefslogtreecommitdiff
path: root/t/t4013/diff.diff_initial..side
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2026-05-12 13:56:02 +0200
committerJunio C Hamano <gitster@pobox.com>2026-05-13 00:48:42 +0900
commitf001b4ab3942cbaff4a39662294ee7191e2dbee5 (patch)
tree078bdc7e2d1178dab72819976a712c975d5d4aff /t/t4013/diff.diff_initial..side
parent8feb5702163a32384d098e2c9ad3987928f8c447 (diff)
ls-files: use strbuf_add_uint()
Speed up printing of objectsize values by using the specialized function strbuf_add_uint() as well as strbuf_insert() for padding instead of the general-purpose function strbuf_addf(). Here are the numbers I get when listing files in the Linux kernel repo: Benchmark 1: ./git_main -C ../linux ls-files --format='%(objectsize)' Time (mean ± σ): 257.3 ms ± 0.4 ms [User: 197.4 ms, System: 56.7 ms] Range (min … max): 256.7 ms … 258.1 ms 11 runs Benchmark 2: ./git -C ../linux ls-files --format='%(objectsize)' Time (mean ± σ): 253.4 ms ± 0.3 ms [User: 193.6 ms, System: 56.6 ms] Range (min … max): 253.0 ms … 253.8 ms 11 runs Benchmark 3: ./git_main -C ../linux ls-files --format='%(objectsize:padded)' Time (mean ± σ): 257.9 ms ± 0.3 ms [User: 198.0 ms, System: 56.6 ms] Range (min … max): 257.3 ms … 258.5 ms 11 runs Benchmark 4: ./git -C ../linux ls-files --format='%(objectsize:padded)' Time (mean ± σ): 254.6 ms ± 1.0 ms [User: 194.6 ms, System: 56.7 ms] Range (min … max): 253.7 ms … 256.8 ms 11 runs Summary ./git -C ../linux ls-files --format='%(objectsize)' ran 1.00 ± 0.00 times faster than ./git -C ../linux ls-files --format='%(objectsize:padded)' 1.02 ± 0.00 times faster than ./git_main -C ../linux ls-files --format='%(objectsize)' 1.02 ± 0.00 times faster than ./git_main -C ../linux ls-files --format='%(objectsize:padded)' Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4013/diff.diff_initial..side')
0 files changed, 0 insertions, 0 deletions