git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Lebon <jonathan.lebon@gmail.com>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 3/4] diff-highlight: match up lines before highlighting
Date: Tue, 17 Nov 2015 00:18:28 -0500	[thread overview]
Message-ID: <CAM0PgJ4erahEZsL75c4mytF158xxeE6itG8KOMMi4n-zBTHcww@mail.gmail.com> (raw)
In-Reply-To: <20151103220314.GE22484@sigill.intra.peff.net>

On Tue, Nov 3, 2015 at 5:03 PM, Jeff King <peff@peff.net> wrote:
> Your is _much_ slower. I get:
>
>   real    0m25.538s
>   user    0m25.420s
>   sys     0m0.120s
>
> for the old versus:
>
>   real    2m3.580s
>   user    2m3.548s
>   sys     0m0.156s

Thanks for investigating and trying it out. I got the same results
here as well.

> for your series. In an interactive setting, the latency may not be that
> noticeable, but if you are digging far into history (e.g., "git log -p",
> then using "/" in less to search for a commit or some test), I suspect
> it would be very noticeable.

Agreed.

> I was thinking there was some low-hanging fruit in memoizing the
> calculations, but even the prefix/suffix computation is pairwise. I'm
> not really sure how to make this much faster.

I gave memoization a try to see if it could improve the situation. I also
lowered maxhunksize to 10. Doing `git log -p` on git.git went from 2m31
to 2m11. So I think it would require a whole other approach overall.

> As for the output itself, the diff between the two looks promising. The
> first several cases I looked at ar strict improvements. Some of them are
> kind of weird, especially in English text.

Yes, I'm very happy with the improvements and run with these patches all
the time for now.

> In the other thread I mentioned earlier, the solution I cooked up was
> dropping highlighting entirely for hunks over a certain percentage of
> highlighting. I wonder if we could do something similar here (e.g.,
> don't match lines where more than 50% of the line would be highlighted).

I looked over but haven't tested the patches in the other thread yet. But
overall, the LCS definitely looks promising. I'm hoping to find some time
to have a more serious go at it and maybe pick it up where you left off.

>
> -Peff

Thanks again for reviewing these patches and apologies for the delayed
reply.

Jonathan

  reply	other threads:[~2015-11-17  5:19 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-03  2:05 [PATCH 0/4] diff-highlight: make a few improvements Jonathan Lebon
2015-11-03  2:05 ` [PATCH 1/4] diff-highlight: add `less -r` to cmd in README Jonathan Lebon
2015-11-03  2:41   ` Junio C Hamano
2015-11-03  3:12     ` Jonathan Lebon
2015-11-03 21:14   ` Jeff King
2015-11-03 21:51     ` Junio C Hamano
2015-11-03 21:55       ` Jeff King
2015-11-03  2:05 ` [PATCH 2/4] diff-highlight: factor out prefix/suffix functions Jonathan Lebon
2015-11-03 21:17   ` Jeff King
2015-11-03  2:05 ` [PATCH 3/4] diff-highlight: match up lines before highlighting Jonathan Lebon
2015-11-03 21:44   ` Jeff King
2015-11-03 22:03     ` Jeff King
2015-11-17  5:18       ` Jonathan Lebon [this message]
2015-11-17 22:50         ` Jeff King
2015-11-03  2:05 ` [PATCH 4/4] diff-highlight: add maxhunksize config option Jonathan Lebon
2015-11-03 21:46   ` Jeff King
2015-11-03 22:07 ` [PATCH 0/4] diff-highlight: make a few improvements Jeff King

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=CAM0PgJ4erahEZsL75c4mytF158xxeE6itG8KOMMi4n-zBTHcww@mail.gmail.com \
    --to=jonathan.lebon@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).