Files
git/builtin
Jeff King 79ed0a5e26 cat-file: use a single strbuf for all output
When we're in batch mode, we end up in batch_object_write()
for each object, which allocates its own strbuf for each
call. Instead, we can provide a single "scratch" buffer that
gets reused for each output. When running:

  git cat-file --batch-all-objects --batch-check='%(objectname)'

on git.git, my best-of-five time drops from:

  real	0m0.171s
  user	0m0.159s
  sys	0m0.012s

to:

  real	0m0.133s
  user	0m0.121s
  sys	0m0.012s

Note that we could do this just by putting the "scratch"
pointer into "struct expand_data", but I chose instead to
add an extra parameter to the callstack. That's more
verbose, but it makes it a bit more obvious what is going
on, which in turn makes it easy to see where we need to be
releasing the string in the caller (right after the loop
which uses it in each case).

Based-on-a-patch-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-08-14 12:29:54 -07:00
..
2018-05-30 14:04:05 +09:00
2018-08-02 15:30:45 -07:00
2017-10-06 10:07:18 +09:00
2018-08-02 15:30:41 -07:00
2018-08-02 15:30:42 -07:00
2018-08-02 15:30:42 -07:00
2018-05-13 10:45:05 +09:00
2018-07-18 12:20:28 -07:00
2018-07-24 14:50:46 -07:00
2017-10-07 16:27:55 +09:00
2018-05-08 15:59:16 +09:00
2018-08-02 15:30:43 -07:00
2018-08-02 15:30:42 -07:00
2018-08-02 15:30:44 -07:00
2018-06-01 15:06:37 +09:00
2018-06-01 15:06:40 +09:00
2018-08-02 15:30:42 -07:00
2018-06-01 15:06:38 +09:00
2018-05-23 14:38:15 +09:00
2018-08-02 15:30:44 -07:00
2018-05-30 14:04:05 +09:00
2018-07-18 12:20:28 -07:00
2018-07-18 12:20:28 -07:00
2018-07-18 12:20:28 -07:00
2018-07-18 12:20:28 -07:00
2018-04-16 13:52:29 +09:00
2017-12-13 11:15:14 -08:00
2018-05-30 14:04:05 +09:00
2018-03-15 12:01:08 -07:00
2018-05-29 00:28:22 +09:00
2018-07-18 12:20:28 -07:00
2018-05-08 15:59:16 +09:00