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

Re: Performance issue of 'git branch'

From
CMCarlos R. Mafra <crmafra2@gmail.com>
Date
Jul 23, 2009, 14:45 UTC
Message-ID
<20090723144559.GA20167@Pilar.aei.mpg.de>
In-Reply-To
<m3prbr371l.fsf@localhost.localdomain>
On Thu 23.Jul'09 at  5:42:03 -0700, Jakub Narebski wrote:
Show 22 quoted lines
> Linus Torvalds <torvalds@linux-foundation.org> writes:
> 
> > On Thu, 23 Jul 2009, Carlos R. Mafra wrote:
> > > 
> > > Is there another way to check what is going on with that anomalous lstat()?
> > 
> > I really don't think it's the lstat any more. Your directories look small 
> > and simple, and clearly the indexing made no difference.
> > 
> > See earlier email about using "strace -T" instead of "-tt". Also, I sent 
> > you a patch to try out just a minute ago, I think that may be it.
> > 
> > > [ perhaps I will try 'perf' after I read how to use it ]
> > 
> > I really like 'perf' (it does what oprofile did for me, but without the 
> > headaches), but it doesn't help with IO profiling.
> > 
> > I've actually often wanted to have a 'strace' that shows page faults as 
> > special system calls, but it's sadly nontrivial ;(
> 
> BTW. Would SystemTap help there?  Among contributed scripts there is
> iotimes, so perhaps it would be possible to have iotrace...

I played a bit with 'blktrace' and 'btrace' and had two terminals open side by side, one with 'strace git branch' and the other with 'blktrace'.

It was pretty obvious that exactly at the point where 'git branch' was stalling (without Linus' patch) -- which I thought had to do with lstat() -- there was a flurry of activity going on in 'btrace' output.

It would be nice if 'btrace' could be somehow unified with 'strace', if that makes any sense.

Here are some numbers from my tests with blktrace (blkparse and btrace):

[root@Pilar mafra]# grep git blkparse-patch.txt |wc -l 811 [root@Pilar mafra]# grep git blkparse-nopatch.txt |wc -l 3479

where those lines with 'git' are something like

8,5 0 677 1.787350654 18591 I R 204488479 + 40 [git] 8,0 0 678 1.787370489 18591 A R 204488783 + 96 <- (8,5) 137529800 8,5 0 679 1.787371886 18591 Q R 204488783 + 96 [git] 8,5 0 680 1.787375378 18591 G R 204488783 + 96 [git] 8,5 0 681 1.787377613 18591 I R 204488783 + 96 [git]

And the summary lines also indicate that the non-patched git makes the disc work much harder:

*************** Without Linus' patch ******************************************
Total (8,5):
 Reads Queued:         764,   20,008KiB  Writes Queued:           0,        0KiB
 Read Dispatches:      764,   20,008KiB  Write Dispatches:        0,        0KiB
 Reads Requeued:         0               Writes Requeued:         0
 Reads Completed:      764,   20,008KiB  Writes Completed:        0,        0KiB
 Read Merges:            0,        0KiB  Write Merges:            0,        0KiB
 IO unplugs:           299               Timer unplugs:           2
Throughput (R/W): 4,003KiB/s / 0KiB/s
Events (8,5): 5,266 entries
Skips: 0 forward (0 -   0.0%)
************** With Linus' patch **********************************************
Total (sda5):
 Reads Queued:         171,    3,128KiB	 Writes Queued:           6,       24KiB
 Read Dispatches:      171,    3,128KiB	 Write Dispatches:        2,       24KiB
 Reads Requeued:         0		 Writes Requeued:         0
 Reads Completed:      171,    3,128KiB	 Writes Completed:        2,       24KiB
 Read Merges:            0,        0KiB	 Write Merges:            4,       16KiB
 IO unplugs:            80        	 Timer unplugs:           0
Throughput (R/W): 1,632KiB/s / 12KiB/s
Events (sda5): 1,226 entries
Skips: 0 forward (0 -   0.0%)
Previous: Jakub NarebskiNext: Linus Torvalds
Message 8 of 73 in “Performance issue of 'git branch'”
  1. Carlos R. MafraJul 22, 2009
  2. Linus TorvaldsJul 23, 2009
  3. Linus TorvaldsJul 23, 2009
  4. Linus TorvaldsJul 23, 2009
  5. Carlos R. MafraJul 23, 2009
  6. Linus TorvaldsJul 23, 2009
  7. Jakub NarebskiJul 23, 2009
  8. Carlos R. MafraJul 23, 2009
  9. Linus TorvaldsJul 23, 2009
  10. Carlos R. MafraJul 23, 2009
  11. Linus TorvaldsJul 23, 2009
  12. Linus TorvaldsJul 23, 2009
  13. Linus TorvaldsJul 23, 2009
  14. Linus TorvaldsJul 23, 2009
  15. Tony FinchJul 23, 2009
  16. Linus TorvaldsJul 23, 2009
  17. Newton-Raphson, was Re: Performance issue of 'git branch'Tony Finch, Jul 23, 2009
  18. Johannes SchindelinJul 23, 2009
  19. Tony FinchJul 23, 2009
  20. Johannes SchindelinJul 24, 2009
  21. Carlos R. MafraJul 23, 2009
  22. Carlos R. MafraJul 23, 2009
  23. Carlos R. MafraJul 23, 2009
  24. Linus TorvaldsJul 23, 2009
  25. Linus TorvaldsJul 23, 2009
  26. Junio C HamanoJul 23, 2009
  27. Carlos R. MafraJul 23, 2009
  28. Junio C HamanoJul 23, 2009
  29. Linus TorvaldsJul 23, 2009
  30. Junio C HamanoJul 23, 2009
  31. Junio C HamanoJul 23, 2009
  32. Linus TorvaldsJul 23, 2009
  33. Carlos R. MafraJul 23, 2009
  34. Linus TorvaldsJul 23, 2009
  35. Carlos R. MafraJul 23, 2009
  36. Linus TorvaldsJul 23, 2009
  37. Linus TorvaldsJul 23, 2009
  38. Carlos R. MafraJul 23, 2009
  39. Linus TorvaldsJul 24, 2009
  40. Linus TorvaldsJul 24, 2009
  41. Linus TorvaldsJul 24, 2009
  42. Linus TorvaldsJul 24, 2009
  43. david@lang.hmJul 24, 2009
  44. Linus TorvaldsJul 24, 2009
  45. david@lang.hmJul 24, 2009
  46. Linus TorvaldsJul 25, 2009
  47. Daniel BarkalowJul 25, 2009
  48. Jeff KingAug 7, 2009
  49. Theodore TsoJul 24, 2009
  50. Shawn O. PearceJul 24, 2009
  51. Junio C HamanoJul 24, 2009
  52. Avi KivityJul 26, 2009
  53. Johannes SchindelinJul 26, 2009
  54. Carlos R. MafraJul 24, 2009
  55. Carlos R. MafraJul 25, 2009
  56. Linus TorvaldsJul 25, 2009
  57. Timo HirvonenJul 25, 2009
  58. Reece DunnJul 25, 2009
  59. Mike HommeyJul 25, 2009
  60. Linus TorvaldsJul 25, 2009
  61. Linus TorvaldsJul 25, 2009
  62. Johannes SchindelinJul 25, 2009
  63. Linus TorvaldsJul 26, 2009
  64. Theodore TsoJul 26, 2009
  65. Mike HommeyJul 26, 2009
  66. Johannes SchindelinJul 26, 2009
  67. demerphqJul 26, 2009
  68. demerphqJul 26, 2009
  69. Carlos R. MafraJul 25, 2009
  70. Anders KaseorgJul 23, 2009
  71. Carlos R. MafraJul 23, 2009
  72. SZEDER GáborJul 23, 2009
  73. Carlos R. MafraJul 23, 2009

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.