From: "Marco Costalba" <mcostalba@gmail.com>
To: "Linus Torvalds" <torvalds@linux-foundation.org>
Cc: "Paul Mackerras" <paulus@samba.org>, git@vger.kernel.org
Subject: Re: [PATCH 0/2] History replay support
Date: Sat, 3 Nov 2007 08:56:35 +0100 [thread overview]
Message-ID: <e5bfff550711030056m5f62eb21k4972e1340f7d6e6c@mail.gmail.com> (raw)
In-Reply-To: <alpine.LFD.0.999.0711021809060.3342@woody.linux-foundation.org>
On 11/3/07, Linus Torvalds <torvalds@linux-foundation.org> wrote:
>
>
> On Fri, 2 Nov 2007, Linus Torvalds wrote:
> >
> > The bad news is that it doesn't work well in this simplistic form, because
> > there is a O(n**2) behaviour when replays *do* happen, ie we end up having
> > replays within replays [..]
>
> Gaah. the more I look at this, the more I think the topo sort should be
> done at the visualization side.
>
> It's really quite cheap to do the topo sort, *and* it's really quite cheap
> to do the tests that trigger the topo sort, but what's expensive is to
> re-output all the data again!
>
> The silly thing is, I think I've come up with an "almost optimal"
> solution, but it's so ugly that I'm a bit ashamed of it.
>
> That almost optimal solution is simply:
> - get the first <n> (say: 100) commits, and topo-sort just them. Feed it
> to the visualizer.
> - the visualizer will now have enough to work with in order to show the
> starting screen and set the cursor to the hourglass or whatever the
> "wait for it" thing is.
> - get the rest of the commits at our normal leisurely pace (whether it
> is one second of 17).
> - output the total number of commits (so that the visualizer can re-size
> the slider and/or allocate some big array just once), topo-sort it all,
> and output the full thing.
>
> It's disgusting. But it avoids the unnecessary data transfer - except for
> just the first 100 commits that get sent twice. And it gets what *I* look
> for, namely that "immediate" feel to the initial pop-up of the history.
>
It's not disgusting is human perception oriented !
All this stuff is not needed to get the sha faster, but to let think
the user that are faster. It's for strictly human consumption, so I
would say your "ugly" solution is the best for me.
A bunch of revisions, just to let user eyes to re-focus on new stuff
(and some hundredths of milliseconds are already elapsed after this)
while in the background the real, shadowed, work goes on.
It's also easy on the client GUI side, simply discard all and reload
as soon _correct_ data arrives.
So the new option could became:
git log --fast-output 100 500 --topo-order <...whatever...>
where git log outputs as soon as it can 100 commits and feeds it to
the visualizer. If the _normal_ commits are still not ready after 500
ms are elapsed then git log spits out another 100 commits chunk and so
on at 500ms intervals until good commits are ready. Then outputs the
full thing.
It is very user perception oriented, but hey, so is a GUI!
Marco
P.S: A little optimization for small repositories would be that git
log *waits* at maximum 500ms before to output the first 100 commits
chunk, so that in case of small repos (thousands of revisions) or in
case of warmed up cache the commits in output are already the good
ones, no need for fakes!
next prev parent reply other threads:[~2007-11-03 7:56 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-28 1:39 New features in gitk Paul Mackerras
2007-10-28 5:34 ` Linus Torvalds
2007-10-28 7:11 ` Paul Mackerras
2007-10-28 7:36 ` Steffen Prohaska
2007-10-28 16:50 ` Linus Torvalds
2007-11-01 10:00 ` Paul Mackerras
2007-11-01 15:16 ` Linus Torvalds
2007-11-02 10:19 ` Paul Mackerras
2007-11-02 12:44 ` Marco Costalba
2007-11-02 15:42 ` Linus Torvalds
2007-11-02 16:50 ` Marco Costalba
2007-11-02 18:16 ` Linus Torvalds
2007-11-02 20:31 ` [PATCH 0/2] History replay support Linus Torvalds
2007-11-02 20:32 ` [PATCH 1/2] Simplify topo-sort logic Linus Torvalds
2007-11-02 20:35 ` [PATCH 2/2] Support "history replay" for git log commands Linus Torvalds
2007-11-02 21:05 ` Junio C Hamano
2007-11-02 21:17 ` Linus Torvalds
2007-11-03 1:40 ` [PATCH 0/2] History replay support Linus Torvalds
2007-11-03 7:56 ` Marco Costalba [this message]
2007-11-03 18:11 ` [REPLACEMENT PATCH 2/2] Add "--early-output" log flag for interactive GUI use Linus Torvalds
2007-11-03 19:52 ` Marco Costalba
2007-11-04 3:06 ` Paul Mackerras
2007-11-04 5:38 ` Linus Torvalds
2007-11-04 7:10 ` Paul Mackerras
2007-11-04 7:52 ` Marco Costalba
2007-11-04 18:11 ` Linus Torvalds
2007-11-04 20:12 ` [PATCH 3/2] Enhance --early-output format Linus Torvalds
2007-11-05 20:24 ` Junio C Hamano
2007-11-05 20:47 ` Linus Torvalds
2007-11-05 21:22 ` Linus Torvalds
2007-11-05 21:35 ` Linus Torvalds
2007-11-13 4:58 ` [PATCH 4/2] Fix parent rewriting in --early-output Linus Torvalds
2007-11-13 5:43 ` Junio C Hamano
2007-11-13 6:46 ` Linus Torvalds
2007-11-13 7:16 ` Linus Torvalds
2007-11-13 7:53 ` Sven Verdoolaege
2007-11-13 8:48 ` Junio C Hamano
2007-11-13 8:01 ` Shawn O. Pearce
2007-11-13 8:24 ` Junio C Hamano
2007-11-13 9:59 ` Paul Mackerras
2007-11-13 18:53 ` Junio C Hamano
2007-11-13 21:55 ` Paul Mackerras
2007-11-16 7:30 ` Marco Costalba
2007-11-04 0:32 ` [PATCH 0/2] History replay support Paul Mackerras
2007-11-02 18:17 ` New features in gitk Johannes Schindelin
2007-11-02 15:03 ` Linus Torvalds
2007-11-01 11:37 ` Paul Mackerras
2007-11-01 15:47 ` Linus Torvalds
2007-11-01 16:21 ` Linus Torvalds
2007-10-28 18:32 ` Pierre Habouzit
2007-10-28 18:38 ` Mike Hommey
2007-10-28 23:13 ` Paul Mackerras
2007-10-29 6:20 ` Pierre Habouzit
2007-10-29 8:31 ` Jonathan del Strother
2007-10-29 6:24 ` Pierre Habouzit
2007-10-29 13:30 ` Han-Wen Nienhuys
2007-10-29 14:04 ` Michele Ballabio
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=e5bfff550711030056m5f62eb21k4972e1340f7d6e6c@mail.gmail.com \
--to=mcostalba@gmail.com \
--cc=git@vger.kernel.org \
--cc=paulus@samba.org \
--cc=torvalds@linux-foundation.org \
/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).