git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFH] git-log vs git-rev-list performance

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Dec 29, 2007, 18:51 UTC
Message-ID
<alpine.LFD.0.9999.0712291038560.2778@woody.linux-foundation.org>
In-Reply-To
<e5bfff550712290418h22d7f7edqda519e7f4dcd25b8@mail.gmail.com>
On Sat, 29 Dec 2007, Marco Costalba wrote:
>
> [marco@localhost linux-2.6]$ time git log --topo-order --no-color
> --parents --boundary -z --log-size
> --pretty=format:"%m%HX%PX%n%an<%ae>%n%at%n%s%n%b" HEAD > /dev/null
Don't compare "--pretty=format" to the pre-formatted versions.

Use "--pretty=raw" for "git log" if you want to approximate "git rev-list --header".

Or alternatively use the same "--pretty=format:" for git-rev-list.

If you start using anything else, you only have yourself to blame. OF COURSE it's more expensive to pretty-format the messages.

I get
	[torvalds@woody linux]$ time git rev-list \
		--pretty=format:"%m%HX%PX%n%an<%ae>%n%at%n%s%n%b" \
		--topo-order --parents --boundary --header \
		--log-size HEAD	> /dev/null
	real    0m1.596s
	user    0m1.556s
	sys     0m0.040s
	[torvalds@woody linux]$ time git log \
		--pretty=format:"%m%HX%PX%n%an<%ae>%n%at%n%s%n%b" \
		--topo-order --parents --boundary \
		--log-size HEAD > /dev/null
	real    0m1.597s
	user    0m1.548s
	sys     0m0.048s

so I'd say that with the same output, the timings are pretty much the same (except "git log" is more capable - "--log-size" does nothing for "git rev-list", for example).

But if you ask for different formats, they'll have different performance, even if you then use the same command (ie "git log" will be slower than "git log" depending on the command line arguments!)

		Linus
Previous: Marco CostalbaNext: Marco Costalba
Message 2 of 3 in “[RFH] git-log vs git-rev-list performance”
  1. Marco CostalbaDec 29, 2007
  2. Linus TorvaldsDec 29, 2007
  3. Marco CostalbaDec 29, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.