Re: [PATCH] xdiff: improve trimming preprocessing

2018-03-07 Thread René Scharfe
Am 07.03.2018 um 10:36 schrieb Eric Sunshine: > On Tue, Mar 6, 2018 at 6:05 PM, Jun Wu wrote: >> Excerpts from Eric Sunshine's message of 2018-03-06 14:23:46 -0500: >>> On Tue, Mar 6, 2018 at 6:53 AM, Jun Wu wrote: + printf "x%.0s" {1..934} >>d # pad common

Re: [PATCH] xdiff: improve trimming preprocessing

2018-03-07 Thread Eric Sunshine
On Tue, Mar 6, 2018 at 6:05 PM, Jun Wu wrote: > Excerpts from Eric Sunshine's message of 2018-03-06 14:23:46 -0500: >> On Tue, Mar 6, 2018 at 6:53 AM, Jun Wu wrote: >> > + printf "x%.0s" {1..934} >>d # pad common suffix to 1024 bytes >> >> The expression {x..y} is

Re: [PATCH] xdiff: improve trimming preprocessing

2018-03-06 Thread Jun Wu
Excerpts from Junio C Hamano's message of 2018-03-06 11:29:44 -0800: > Eric Sunshine writes: > > > On Tue, Mar 6, 2018 at 6:53 AM, Jun Wu wrote: > >> xdiff-interface trims common suffix if ctxlen is 0. Teach it to also > >> trim common prefix, and trim

Re: [PATCH] xdiff: improve trimming preprocessing

2018-03-06 Thread Jun Wu
Excerpts from Eric Sunshine's message of 2018-03-06 14:23:46 -0500: > On Tue, Mar 6, 2018 at 6:53 AM, Jun Wu wrote: > > + printf "x%.0s" {1..934} >>d # pad common suffix to 1024 bytes > > The expression {x..y} is not portable to non-POSIX shells. Is there a recommended way to

Re: [PATCH] xdiff: improve trimming preprocessing

2018-03-06 Thread Junio C Hamano
Eric Sunshine writes: > On Tue, Mar 6, 2018 at 6:53 AM, Jun Wu wrote: >> xdiff-interface trims common suffix if ctxlen is 0. Teach it to also >> trim common prefix, and trim less lines if ctxlen > 0. So it can benefit >> the default diff command, as seen

Re: [PATCH] xdiff: improve trimming preprocessing

2018-03-06 Thread Eric Sunshine
On Tue, Mar 6, 2018 at 6:53 AM, Jun Wu wrote: > xdiff-interface trims common suffix if ctxlen is 0. Teach it to also > trim common prefix, and trim less lines if ctxlen > 0. So it can benefit > the default diff command, as seen by profiling: [...] A few comments (below) based upon

[PATCH] xdiff: improve trimming preprocessing

2018-03-06 Thread Jun Wu
xdiff-interface trims common suffix if ctxlen is 0. Teach it to also trim common prefix, and trim less lines if ctxlen > 0. So it can benefit the default diff command, as seen by profiling: $ GIT_PERF_REPEAT_COUNT=10 ./run origin/master . -- p4000-diff-algorithms.sh [...] Test