Re: git-log to go forward instead of reverse?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Mon, 10 Jul 2006, Linus Torvalds wrote:
> 
> The difference between getting the first screenful in 0.054 seconds versus 
> it taking 2.218 seconds is quite noticeable, and one of the things I've 
> actually spent a fair amount of time on is to make sure that the 
> incremental output case is the _common_ one for all the normal operations 
> like "git log -p".

Side note: the good news is that even with the reverse generation, if you 
also generate _diffs_, the diffs will be generated incrementally, so:

	// Full "git log" with diffs
	[torvalds@g5 linux]$ time git log -p drivers/serial > /dev/null 

	real    0m3.409s
	user    0m3.360s
	sys     0m0.052s

	// First screenful of reverse git log with diffs
	[torvalds@g5 linux]$ time git log -p --reverse drivers/serial | head -25 > /dev/null 
	
	real    0m2.228s
	user    0m2.216s
	sys     0m0.012s

	// First screenful of regular git log with diffs
	[torvalds@g5 linux]$ time git log -p drivers/serial | head -25 > /dev/null 
	
	real    0m0.038s
	user    0m0.036s
	sys     0m0.004s

here you can see how the full "git log -p" is obviously more expensive 
than the full "git log" was (the diff generation adds about a second to 
the full time), but because the diffs are generated incrementally as they 
are shown even with "--reverse", the first screenful of the "--reverse" 
case didn't get any more expensive, because we didn't generate all the 
diffs up-front, just the ones we needed.

And the first screenfull of the normal case obviously stays really fast, 
because both history generation _and_ diff generation is all on-the-fly.

			Linus
-
: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]