Re: [RFH] git-log vs git-rev-list performance
From: Marco Costalba <hidden>
Date: 2016-06-15 22:44:01
On Dec 29, 2007 7:51 PM, Linus Torvalds [off-list ref] wrote:
On Sat, 29 Dec 2007, Marco Costalba wrote:quoted
[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/nullDon't compare "--pretty=format" to the pre-formatted versions. Use "--pretty=raw" for "git log" if you want to approximate "git rev-list --header".
I have switched to --pretty=format instead of preformatted one to save RAM, becuase needed memory is about 35% less with a custom format, the preformatted ones give me additional info that is not shown on qgit so it's just a waste. As example a full Linux tree loaded with qgit takes less then 80MB, with gitk as comparison we are above 400MB although of course the optimized format is not the whole reason for this difference. What I have seen looking expecially at the pretty.c sources with a profiler is that the custom format is continuosly reparsed _for each revision_ also if it never changes during the whole git-log run. This could explain why the custom format although cheaper in terms of quantity of outputted data is slower then a preformatted one. A caching of the parsed custom --pretty=format at the beginning of git-log could help... Marco