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

Re: [PATCH] fmt-merge-msg: avoid open "-|" list form for Perl 5.6

From
Linus Torvalds <torvalds@osdl.org>
Date
Feb 24, 2006, 16:14 UTC
Message-ID
<Pine.LNX.4.64.0602240800240.3771@g5.osdl.org>
In-Reply-To
<Pine.LNX.4.63.0602241440330.9461@wbgn013.biozentrum.uni-wuerzburg.de>
On Fri, 24 Feb 2006, Johannes Schindelin wrote:
Show 6 quoted lines
> 
> Sorry, but no. Really no. Pipes have several advantages over temporary 
> files:
> 
> - The second program can already work on the data before the first 
>   finishes.

This really is a _huge_ issue in general, although probably not a very big one in this case.

This is what I talked about when I said "streaming" data. Look at the difference between

	git whatchanged -s drivers/usb
and
	git log drivers/usb
in the kernel repo. They give almost the same output, but...

Notice how one starts _immediately_, while the other starts after a few seconds (or, if you have a slow machine, and an unpacked archive, after tens of seconds or longer).

And the reason is that "git log" uses "git-rev-list" with a path limiter, and currently that ends up having to walk basically the whole history in order to generate a minimal graph.

In contrast, "git-whatchanged" uses "git-diff-tree" to limit the output, and git-diff-tree doesn't care about "minimal graph" or crud like that: it just cares about discarding any local commits that aren't interesting. It doesn't need to worry about updating parent chains etc, so it can do it all incrementally - and can thus start output as soon as it gets anything at all.

Now, maybe you think that "a few seconds" isn't a big deal. Sure, it's actually fast as hell, considering what it is doing, and anybody should be really really impressed that we can do that at all.

But (a) it _is_ a huge deal. Responsiveness is really important. And worse: (b) it scales badly with repository size. Creating the whole data-set before starting to output it really doesn't scale.

Now, I have ways to make "git-rev-list" better. It doesn't really need to walk the _whole_ history for its path limiting before it can start outputting stuff: it really _could_ do things more incrementally. However, it's a real bitch sometimes to work with incremental data when you don't know everything, so it gets a lot more complicated.

So my point isn't that "git log drivers/usb" will get less and less responsive over time. I can fix that - eventually. My point is that in order to make it more responsive, I need to make it less synchronous. More "streaming".

And that is where a pipe is so much better than a file. It's very fundamentally a streaming interface.

However, I suspect some of these issues are non-issues for the perl programs that work with a few entries at a time.

		Linus
Previous: Johannes SchindelinNext: Eric Wong
Message 65 of 68 in “Should we support Perl 5.6?”
  1. Johannes SchindelinFeb 20, 2006
  2. Eric WongFeb 20, 2006
  3. Andreas EricssonFeb 20, 2006
  4. Junio C HamanoFeb 20, 2006
  5. fmt-merge-msg: avoid open "-|" list form for Perl 5.6Junio C Hamano, Feb 20, 2006
  6. rerere: avoid open "-|" list form for Perl 5.6Junio C Hamano, Feb 20, 2006
  7. send-email: avoid open "-|" list form for Perl 5.6Junio C Hamano, Feb 20, 2006
  8. svmimport: avoid open "-|" list form for Perl 5.6Junio C Hamano, Feb 20, 2006
  9. cvsimport: avoid open "-|" list form for Perl 5.6Junio C Hamano, Feb 20, 2006
  10. Alex RiesenFeb 21, 2006
  11. Sam VilainFeb 21, 2006
  12. Alex RiesenFeb 21, 2006
  13. Johannes SchindelinFeb 21, 2006
  14. Eric WongFeb 21, 2006
  15. Shawn PearceFeb 21, 2006
  16. Martin LanghoffFeb 21, 2006
  17. Sam VilainFeb 21, 2006
  18. Alex RiesenFeb 22, 2006
  19. Johannes SchindelinFeb 22, 2006
  20. Sam VilainFeb 22, 2006
  21. Junio C HamanoFeb 22, 2006
  22. Johannes SchindelinFeb 22, 2006
  23. Junio C HamanoFeb 22, 2006
  24. Alex RiesenFeb 23, 2006
  25. Junio C HamanoFeb 23, 2006
  26. Alex RiesenFeb 23, 2006
  27. Alex RiesenFeb 23, 2006
  28. Andreas EricssonFeb 23, 2006
  29. Alex RiesenFeb 23, 2006
  30. Andreas EricssonFeb 23, 2006
  31. Alex RiesenFeb 23, 2006
  32. Andreas EricssonFeb 23, 2006
  33. Linus TorvaldsFeb 23, 2006
  34. Junio C HamanoFeb 23, 2006
  35. Johannes SchindelinFeb 23, 2006
  36. Linus TorvaldsFeb 23, 2006
  37. Johannes SchindelinFeb 23, 2006
  38. Linus TorvaldsFeb 23, 2006
  39. Sam VilainFeb 23, 2006
  40. Linus TorvaldsFeb 24, 2006
  41. Alex RiesenFeb 23, 2006
  42. Christopher FaylorFeb 26, 2006
  43. Linus TorvaldsFeb 26, 2006
  44. Christopher FaylorFeb 26, 2006
  45. Alex RiesenMar 2, 2006
  46. Mark WoodingMar 2, 2006
  47. Alex RiesenMar 2, 2006
  48. Christopher FaylorMar 2, 2006
  49. Alex RiesenMar 2, 2006
  50. NT directory traversal speed on 25K files on CygwinRutger Nijlunsing, Feb 26, 2006
  51. Christopher FaylorFeb 27, 2006
  52. Rutger NijlunsingFeb 27, 2006
  53. Christopher FaylorFeb 27, 2006
  54. Andreas EricssonFeb 27, 2006
  55. Rutger NijlunsingFeb 27, 2006
  56. Alex RiesenMar 2, 2006
  57. Alex RiesenMar 2, 2006
  58. Christopher FaylorMar 2, 2006
  59. Alex RiesenMar 2, 2006
  60. Andreas EricssonMar 2, 2006
  61. Alex RiesenMar 2, 2006
  62. Christopher FaylorFeb 26, 2006
  63. Eric WongFeb 24, 2006
  64. Johannes SchindelinFeb 24, 2006
  65. Linus TorvaldsFeb 24, 2006
  66. Eric WongFeb 21, 2006
  67. Alex RiesenFeb 21, 2006
  68. Ron ParkerFeb 21, 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.