All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jun Wu <quark@fb.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Eric Sunshine <sunshine@sunshineco.com>, git <git@vger.kernel.org>
Subject: Re: [PATCH] xdiff: improve trimming preprocessing
Date: Tue, 6 Mar 2018 15:59:21 -0800	[thread overview]
Message-ID: <1520378039-sup-4143@x1c> (raw)
In-Reply-To: <xmqq7eqp3suv.fsf@gitster-ct.c.googlers.com>

Excerpts from Junio C Hamano's message of 2018-03-06 11:29:44 -0800:
> Eric Sunshine <sunshine@sunshineco.com> writes:
> 
> > On Tue, Mar 6, 2018 at 6:53 AM, Jun Wu <quark@fb.com> 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: [...]
> 
> I vaguely recall that we have tried this in the distant past, found
> that it produced incorrect result, and that is why we limit the
> optimization for no-context case.
> 
> Does anybody have an archive reference?

I think it's d2f8295 ("Re(-re)*fix trim_common_tail()", 2007-12-20).

Yeah, this is more complex than I thought. In Mercurial's use-case, ctxlen
is 0 and context are added in a higher layer so it's fine.

It's clearly hunk shifting causing problems. I'll send a V2 to forbid hunk
shifting if it can possibly lose context lines. That implies counting suffix
lines, which adds some overhead but the overall perf win still seems
worthwhile.

  reply	other threads:[~2018-03-07  0:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-06 11:53 [PATCH] xdiff: improve trimming preprocessing Jun Wu
2018-03-06 19:23 ` Eric Sunshine
2018-03-06 19:29   ` Junio C Hamano
2018-03-06 23:59     ` Jun Wu [this message]
2018-03-06 23:05   ` Jun Wu
2018-03-07  9:36     ` Eric Sunshine
2018-03-07 14:36       ` René Scharfe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1520378039-sup-4143@x1c \
    --to=quark@fb.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=sunshine@sunshineco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.