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

Re: [RFC \ WISH] Add -o option to git-rev-list

From
MCMarco Costalba <mcostalba@gmail.com>
Date
Dec 11, 2006, 18:59 UTC
Message-ID
<e5bfff550612111059g35f1aa2dmdead17a60f5dfca8@mail.gmail.com>
In-Reply-To
<Pine.LNX.4.64.0612111003140.12500@woody.osdl.org>
On 12/11/06, Linus Torvalds <torvalds@osdl.org> wrote:
Show 5 quoted lines
>
>
>
> However, you seem to continually ignore the thing I've asked you to do
> several times: try with a cold-cache situation.

Yes. I will test it. I was testing with warm cache also to my curiosity about comparing pipes with temporary file reading as data exchange facility. So I needed to avoid HD artifacts.

Show 6 quoted lines
>
>
>   At that point, you'd actually do something that gitk can't do at all,
>   namely work well for the cold-cache not-very-packed large-repository
>   case. ]
>

Removing --topo-order from launch parameters is very simple, see from gitstartup.cpp:

bool Git::startRevList(SCRef args, FileHistory* fh) {
	QString initCmd("git rev-list --header --boundary --parents ");
	if (!isMainHistory(fh)) {
		// fetch history from all branches so any revision in
		// main view that changes the file is always found
		SCRef allBranches = getAllRefSha(BRANCH).join(" ");
		initCmd.append("--remove-empty " + allBranches + " -- ");
	} else
		initCmd.append("--topo-order ");
	return startParseProc(initCmd + args, fh);
}

It is already removed from file history fetching because there the history it's _almost_ linear and you gain the speed without noticing the different graph layout. But for main view I fear that complicated branch structures could became difficult to follow without --topo-order. Perhaps an option in settings?

Show 8 quoted lines
> To see this in practice (even with hot-caches), do something like the
> following on the full historic Linux archive:
>
>         time sh -c "git rev-list HEAD | head"
>         time sh -c "git rev-list --topo-order HEAD | head"
>
> where for me, the firstone takes 0.002s, and the second one takes 0.878s.
>
This is  the data:

$ pwd /git/linux-2.6 bash-3.1$ time sh -c "git rev-list HEAD | head" 200d018eff4be3a1fb9823441cfcebb7de86a677 f0647a52974daccbe20990fb6341f07792445fe0 c25c79d80e02db1bd993426f979c5f1b42a0f132 9fd32cfbb602f3e5e898faa61d83c4a7897bd48a ed99e2bc1dc5dc54eb5a019f4975562dbef20103 773ff78838ca3c07245e45c06235e0baaa5f710a 52ffe760ea9ec407292d093c3f06c1cda5187228 14b36af46a1d3652aff6734ea24816995dff8123 eb991b39385c7b04923d701764a34694ec54b53d 88032b322a38b37335c8cb2e3473a45c81d280eb 0.08user 0.02system 0:00.10elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (0major+3631minor)pagefaults 0swaps

bash-3.1$ time sh -c "git rev-list --topo-order HEAD | head" 200d018eff4be3a1fb9823441cfcebb7de86a677 f0647a52974daccbe20990fb6341f07792445fe0 c25c79d80e02db1bd993426f979c5f1b42a0f132 9fd32cfbb602f3e5e898faa61d83c4a7897bd48a ed99e2bc1dc5dc54eb5a019f4975562dbef20103 773ff78838ca3c07245e45c06235e0baaa5f710a 52ffe760ea9ec407292d093c3f06c1cda5187228 14b36af46a1d3652aff6734ea24816995dff8123 eb991b39385c7b04923d701764a34694ec54b53d 33ec32fae0e2c4433bfd1e74cbde6cb16604a719 2.84user 0.12system 0:03.05elapsed 97%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (0major+12086minor)pagefaults 0swaps

Also the long awaited ;-)

$ time sh -c "git rev-list --header --boundary --parents --topo-order HEAD | cat > /dev/null" 3.75user 0.55system 0:04.42elapsed 97%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (0major+18822minor)pagefaults 0swaps

$ time sh -c "git rev-list --header --boundary --parents --topo-order HEAD > /tmp/tmp.txt; cat /tmp/tmp.txt > /dev/null" 3.50user 0.30system 0:03.92elapsed 97%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (0major+18800minor)pagefaults 0swaps

Previous: Linus TorvaldsNext: Linus Torvalds
Message 20 of 36 in “[RFC \ WISH] Add -o option to git-rev-list”
  1. Marco CostalbaDec 10, 2006
  2. Alex RiesenDec 10, 2006
  3. Linus TorvaldsDec 10, 2006
  4. Marco CostalbaDec 10, 2006
  5. Linus TorvaldsDec 10, 2006
  6. Linus TorvaldsDec 10, 2006
  7. Marco CostalbaDec 10, 2006
  8. Marco CostalbaDec 10, 2006
  9. Linus TorvaldsDec 10, 2006
  10. Marco CostalbaDec 10, 2006
  11. Linus TorvaldsDec 10, 2006
  12. Marco CostalbaDec 11, 2006
  13. Linus TorvaldsDec 11, 2006
  14. Marco CostalbaDec 11, 2006
  15. Alex RiesenDec 11, 2006
  16. Linus TorvaldsDec 11, 2006
  17. Linus TorvaldsDec 11, 2006
  18. Marco CostalbaDec 11, 2006
  19. Linus TorvaldsDec 11, 2006
  20. Marco CostalbaDec 11, 2006
  21. Linus TorvaldsDec 11, 2006
  22. Josef WeidendorferDec 11, 2006
  23. Linus TorvaldsDec 11, 2006
  24. Josef WeidendorferDec 11, 2006
  25. Linus TorvaldsDec 11, 2006
  26. Marco CostalbaDec 15, 2006
  27. Linus TorvaldsDec 15, 2006
  28. Marco CostalbaDec 15, 2006
  29. Marco CostalbaDec 15, 2006
  30. Josef WeidendorferDec 11, 2006
  31. Marco CostalbaDec 11, 2006
  32. Josef WeidendorferDec 11, 2006
  33. Marco CostalbaDec 11, 2006
  34. Andreas EricssonDec 11, 2006
  35. Marco CostalbaDec 11, 2006
  36. Andreas EricssonDec 11, 2006

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.