Re: [PATCH 3/4] cat-file: use a single strbuf for all output

2018-08-14 Thread Jeff King
On Tue, Aug 14, 2018 at 09:30:57PM +0200, René Scharfe wrote: > > -static void batch_object_write(const char *obj_name, struct batch_options > > *opt, > > +static void batch_object_write(const char *obj_name, > > + struct strbuf *scratch, > > +

Re: [PATCH 3/4] cat-file: use a single strbuf for all output

2018-08-14 Thread René Scharfe
Am 14.08.2018 um 20:20 schrieb Jeff King: > 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

[PATCH 3/4] cat-file: use a single strbuf for all output

2018-08-14 Thread Jeff King
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