Re: [PATCH v2] unpack-trees: avoid duplicate ODB lookups during checkout

2017-04-11 Thread Jeff Hostetler
On 4/10/2017 7:09 PM, René Scharfe wrote: Am 10.04.2017 um 23:26 schrieb Jeff Hostetler: On 4/8/2017 10:06 AM, René Scharfe wrote: Am 07.04.2017 um 17:53 schrieb g...@jeffhostetler.com: +/* implicitly borrow buf[i-1] inside tree_desc[i] */ +memcpy([i], [i-1],

Re: [PATCH v2] unpack-trees: avoid duplicate ODB lookups during checkout

2017-04-10 Thread René Scharfe
Am 10.04.2017 um 23:26 schrieb Jeff Hostetler: > On 4/8/2017 10:06 AM, René Scharfe wrote: >> Am 07.04.2017 um 17:53 schrieb g...@jeffhostetler.com: >>> +/* implicitly borrow buf[i-1] inside tree_desc[i] */ >>> +memcpy([i], [i-1], sizeof(struct tree_desc)); >> >> An

Re: [PATCH v2] unpack-trees: avoid duplicate ODB lookups during checkout

2017-04-10 Thread Jeff Hostetler
On 4/10/2017 4:55 PM, Jeff King wrote: On Sat, Apr 08, 2017 at 04:06:41PM +0200, René Scharfe wrote: + } else if (i > 1 && are_same_oid([i], [i-2])) { + /* implicitly borrow buf[i-2] inside tree_desc[i] */ + memcpy([i], [i-2],

Re: [PATCH v2] unpack-trees: avoid duplicate ODB lookups during checkout

2017-04-10 Thread Jeff Hostetler
On 4/8/2017 10:06 AM, René Scharfe wrote: Am 07.04.2017 um 17:53 schrieb g...@jeffhostetler.com: From: Jeff Hostetler Teach traverse_trees_recursive() to not do redundant ODB lookups when both directories refer to the same OID. In operations such as read-tree,

Re: [PATCH v2] unpack-trees: avoid duplicate ODB lookups during checkout

2017-04-10 Thread Jeff King
On Sat, Apr 08, 2017 at 04:06:41PM +0200, René Scharfe wrote: > > + } else if (i > 1 && are_same_oid([i], [i-2])) { > > + /* implicitly borrow buf[i-2] inside tree_desc[i] */ > > + memcpy([i], [i-2], sizeof(struct tree_desc)); > > Similar case. > >

Re: [PATCH v2] unpack-trees: avoid duplicate ODB lookups during checkout

2017-04-08 Thread René Scharfe
Am 07.04.2017 um 17:53 schrieb g...@jeffhostetler.com: From: Jeff Hostetler Teach traverse_trees_recursive() to not do redundant ODB lookups when both directories refer to the same OID. In operations such as read-tree, checkout, and merge when the differences between

[PATCH v2] unpack-trees: avoid duplicate ODB lookups during checkout

2017-04-07 Thread git
From: Jeff Hostetler Version 2 simplifies this and just copies the tree_descriptor data and borrows the underlying buffer without mallocing. It also handles the n=3 cases, so merges shold be helped too. I've updated the p0004 perf times in the commit message. The V2

[PATCH v2] unpack-trees: avoid duplicate ODB lookups during checkout

2017-04-07 Thread git
From: Jeff Hostetler Teach traverse_trees_recursive() to not do redundant ODB lookups when both directories refer to the same OID. In operations such as read-tree, checkout, and merge when the differences between the commits are relatively small, there will likely be