Re: [PATCH 08/15] name-rev: pull out deref handling from the recursion

2019-09-26 Thread SZEDER Gábor
On Tue, Sep 24, 2019 at 07:03:50PM +0200, René Scharfe wrote: > Am 23.09.19 um 22:47 schrieb SZEDER Gábor: > > On Mon, Sep 23, 2019 at 09:55:11PM +0200, René Scharfe wrote: > >> -- >8 -- > >> Subject: [PATCH] name-rev: use FLEX_ARRAY for tip_name in struct rev_name > >> > >> Give each rev_name its

Re: [PATCH 08/15] name-rev: pull out deref handling from the recursion

2019-09-24 Thread René Scharfe
Am 23.09.19 um 22:47 schrieb SZEDER Gábor: > On Mon, Sep 23, 2019 at 09:55:11PM +0200, René Scharfe wrote: >> -- >8 -- >> Subject: [PATCH] name-rev: use FLEX_ARRAY for tip_name in struct rev_name >> >> Give each rev_name its very own tip_name string. This simplifies memory >> ownership, as callers

Re: [PATCH 08/15] name-rev: pull out deref handling from the recursion

2019-09-23 Thread SZEDER Gábor
On Mon, Sep 23, 2019 at 09:55:11PM +0200, René Scharfe wrote: > -- >8 -- > Subject: [PATCH] name-rev: use FLEX_ARRAY for tip_name in struct rev_name > > Give each rev_name its very own tip_name string. This simplifies memory > ownership, as callers of name_rev() only have to make sure the tip_nam

Re: [PATCH 08/15] name-rev: pull out deref handling from the recursion

2019-09-23 Thread René Scharfe
Am 23.09.19 um 20:59 schrieb SZEDER Gábor: > On Mon, Sep 23, 2019 at 08:43:11PM +0200, René Scharfe wrote: >>> It's overall memory usage, the avarage of five runs of: >>> >>> /usr/bin/time --format='%M' ~/src/git/git name-rev --all >>> And how much is that in absolute terms? >>> >>> git:

Re: [PATCH 08/15] name-rev: pull out deref handling from the recursion

2019-09-23 Thread SZEDER Gábor
On Mon, Sep 23, 2019 at 08:43:11PM +0200, René Scharfe wrote: > > It's overall memory usage, the avarage of five runs of: > > > > /usr/bin/time --format='%M' ~/src/git/git name-rev --all > > > >> And how much is that in absolute terms? > > > > git: 29801 -> 28514 > > linux: 317018 -> 332218

Re: [PATCH 08/15] name-rev: pull out deref handling from the recursion

2019-09-23 Thread René Scharfe
Am 22.09.19 um 21:05 schrieb SZEDER Gábor: > On Sat, Sep 21, 2019 at 02:37:18PM +0200, René Scharfe wrote: >> Am 21.09.19 um 11:57 schrieb SZEDER Gábor: >>> On Fri, Sep 20, 2019 at 08:14:07PM +0200, SZEDER Gábor wrote: On Fri, Sep 20, 2019 at 08:13:02PM +0200, SZEDER Gábor wrote: >> If the

Re: [PATCH 08/15] name-rev: pull out deref handling from the recursion

2019-09-22 Thread SZEDER Gábor
On Sat, Sep 21, 2019 at 02:37:18PM +0200, René Scharfe wrote: > Am 21.09.19 um 11:57 schrieb SZEDER Gábor: > > On Fri, Sep 20, 2019 at 08:14:07PM +0200, SZEDER Gábor wrote: > >> On Fri, Sep 20, 2019 at 08:13:02PM +0200, SZEDER Gábor wrote: > If the (re)introduced leak doesn't impact performanc

Re: [PATCH 08/15] name-rev: pull out deref handling from the recursion

2019-09-21 Thread René Scharfe
Am 21.09.19 um 16:21 schrieb SZEDER Gábor: > On Sat, Sep 21, 2019 at 02:37:05PM +0200, René Scharfe wrote: >> Am 20.09.19 um 20:13 schrieb SZEDER Gábor: > @@ -280,12 +269,16 @@ static int name_ref(const char *path, const struct > object_id *oid, int flags, vo > if (o && o->type == OB

Re: [PATCH 08/15] name-rev: pull out deref handling from the recursion

2019-09-21 Thread SZEDER Gábor
On Sat, Sep 21, 2019 at 02:37:05PM +0200, René Scharfe wrote: > Am 20.09.19 um 20:13 schrieb SZEDER Gábor: > >>> @@ -280,12 +269,16 @@ static int name_ref(const char *path, const struct > >>> object_id *oid, int flags, vo > >>> if (o && o->type == OBJ_COMMIT) { > >>> struct commit *com

Re: [PATCH 08/15] name-rev: pull out deref handling from the recursion

2019-09-21 Thread René Scharfe
Am 20.09.19 um 20:13 schrieb SZEDER Gábor: >>> @@ -280,12 +269,16 @@ static int name_ref(const char *path, const struct >>> object_id *oid, int flags, vo >>> if (o && o->type == OBJ_COMMIT) { >>> struct commit *commit = (struct commit *)o; >>> int from_tag = starts_with

Re: [PATCH 08/15] name-rev: pull out deref handling from the recursion

2019-09-21 Thread René Scharfe
Am 21.09.19 um 11:57 schrieb SZEDER Gábor: > On Fri, Sep 20, 2019 at 08:14:07PM +0200, SZEDER Gábor wrote: >> On Fri, Sep 20, 2019 at 08:13:02PM +0200, SZEDER Gábor wrote: If the (re)introduced leak doesn't impact performance and memory usage too much then duplicating tip_name again in na

Re: [PATCH 08/15] name-rev: pull out deref handling from the recursion

2019-09-21 Thread SZEDER Gábor
On Fri, Sep 20, 2019 at 08:14:07PM +0200, SZEDER Gábor wrote: > On Fri, Sep 20, 2019 at 08:13:02PM +0200, SZEDER Gábor wrote: > > > If the (re)introduced leak doesn't impact performance and memory > > > usage too much then duplicating tip_name again in name_rev() or > > > rather your new create_or_

Re: [PATCH 08/15] name-rev: pull out deref handling from the recursion

2019-09-20 Thread SZEDER Gábor
> > @@ -280,12 +269,16 @@ static int name_ref(const char *path, const struct > > object_id *oid, int flags, vo > > if (o && o->type == OBJ_COMMIT) { > > struct commit *commit = (struct commit *)o; > > int from_tag = starts_with(path, "refs/tags/"); > > + const

Re: [PATCH 08/15] name-rev: pull out deref handling from the recursion

2019-09-20 Thread SZEDER Gábor
On Fri, Sep 20, 2019 at 08:13:02PM +0200, SZEDER Gábor wrote: > > If the (re)introduced leak doesn't impact performance and memory > > usage too much then duplicating tip_name again in name_rev() or > > rather your new create_or_update_name() would likely make the > > lifetimes of those string buff

Re: [PATCH 08/15] name-rev: pull out deref handling from the recursion

2019-09-20 Thread SZEDER Gábor
On Fri, Sep 20, 2019 at 11:21:53AM -0400, Derrick Stolee wrote: > On 9/19/2019 5:47 PM, SZEDER Gábor wrote: > > The 'if (deref) { ... }' condition near the beginning of the recursive > > name_rev() function can only ever be true in the first invocation, > > because the 'deref' parameter is always 0

Re: [PATCH 08/15] name-rev: pull out deref handling from the recursion

2019-09-20 Thread René Scharfe
Am 19.09.19 um 23:47 schrieb SZEDER Gábor: > The 'if (deref) { ... }' condition near the beginning of the recursive > name_rev() function can only ever be true in the first invocation, > because the 'deref' parameter is always 0 in the subsequent recursive > invocations. > > Extract this condition

Re: [PATCH 08/15] name-rev: pull out deref handling from the recursion

2019-09-20 Thread Derrick Stolee
On 9/19/2019 5:47 PM, SZEDER Gábor wrote: > The 'if (deref) { ... }' condition near the beginning of the recursive > name_rev() function can only ever be true in the first invocation, > because the 'deref' parameter is always 0 in the subsequent recursive > invocations. > > Extract this condition

[PATCH 08/15] name-rev: pull out deref handling from the recursion

2019-09-19 Thread SZEDER Gábor
The 'if (deref) { ... }' condition near the beginning of the recursive name_rev() function can only ever be true in the first invocation, because the 'deref' parameter is always 0 in the subsequent recursive invocations. Extract this condition from the recursion into name_rev()'s caller and drop t