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

Re: [PATCH] git gc: Speed it up by 18% via faster hash comparisons

From
IMIngo Molnar <mingo@elte.hu>
Date
Apr 27, 2011, 23:10 UTC
Message-ID
<20110427231012.GA17807@elte.hu>
In-Reply-To
<20110427225114.GA16765@elte.hu>
* Ingo Molnar <mingo@elte.hu> wrote:
> I suspect 'git fsck' got faster as well, but i have not measured that.
It got faster a bit:
 #
 # Before:
 #
 $ perf stat --sync --repeat 5 ./git fsck >/dev/null
 Performance counter stats for './git fsck' (5 runs):
      32011.163574 task-clock               #    0.998 CPUs utilized            ( +-  0.08% )
                46 context-switches         #    0.000 M/sec                    ( +-  2.77% )
                 0 CPU-migrations           #    0.000 M/sec                    ( +-  0.00% )
            60,279 page-faults              #    0.002 M/sec                    ( +- 12.21% )
   102,597,312,322 cycles                   #    3.205 GHz                      ( +-  0.08% )
    27,303,254,781 stalled-cycles           #   26.61% of all cycles are idle   ( +-  2.51% )
   152,359,589,474 instructions             #    1.49  insns per cycle        
                                            #    0.18  stalled cycles per insn  ( +-  0.03% )
    13,225,673,730 branches                 #  413.158 M/sec                    ( +-  0.06% )
     1,226,749,384 branch-misses            #    9.28% of all branches          ( +-  0.08% )
       32.083499222  seconds time elapsed  ( +-  0.07% )
 #
 # After:
 #
 Performance counter stats for './git fsck' (5 runs):
      31605.868825 task-clock               #    0.998 CPUs utilized            ( +-  0.08% )
                42 context-switches         #    0.000 M/sec                    ( +-  3.92% )
                 0 CPU-migrations           #    0.000 M/sec                    ( +-100.00% )
            62,979 page-faults              #    0.002 M/sec                    ( +- 14.72% )
   101,297,181,916 cycles                   #    3.205 GHz                      ( +-  0.08% )
    27,173,614,721 stalled-cycles           #   26.83% of all cycles are idle   ( +-  0.49% )
   155,074,859,385 instructions             #    1.53  insns per cycle        
                                            #    0.18  stalled cycles per insn  ( +-  0.01% )
    14,132,018,558 branches                 #  447.133 M/sec                    ( +-  0.02% )
     1,207,054,592 branch-misses            #    8.54% of all branches          ( +-  0.03% )
       31.675135938  seconds time elapsed  ( +-  0.08% )
so there's a +1.3% speedup.
But git fsck stalls are dominated by libz and other external libraries:
# Events: 30K stalled-cycles
#
# Overhead  Command          Shared Object                        Symbol
# ........  .......  .....................  ............................
#
    36.13%      git  libz.so.1.2.5          [.] 0x90be          
    18.27%      git  libc-2.13.90.so        [.] __memcpy_ssse3_back
    13.68%      git  libcrypto.so.1.0.0d    [.] sha1_block_data_order
     5.85%      git  libz.so.1.2.5          [.] inflate
     4.69%      git  git                    [.] lookup_object
     4.58%      git  libz.so.1.2.5          [.] adler32
     4.30%      git  libz.so.1.2.5          [.] 0xc280          
     2.19%      git  libc-2.13.90.so        [.] _int_malloc
So those dominate execution time.
	Ingo
Previous: Ingo MolnarNext: Jonathan Nieder
Message 2 of 45 in “git gc: Speed it up by 18% via faster hash comparisons”
  1. git gc: Speed it up by 18% via faster hash comparisonsIngo Molnar, Apr 27, 2011
  2. Ingo MolnarApr 27, 2011
  3. Jonathan NiederApr 27, 2011
  4. Ingo MolnarApr 28, 2011
  5. Jonathan NiederApr 28, 2011
  6. Ingo MolnarApr 28, 2011
  7. Dmitry PotapovApr 28, 2011
  8. Junio C HamanoApr 27, 2011
  9. Ralf BaechleApr 28, 2011
  10. Bernhard R. LinkApr 28, 2011
  11. Andreas EricssonApr 28, 2011
  12. Erik Faye-LundApr 28, 2011
  13. H. Peter AnvinApr 28, 2011
  14. Ingo MolnarApr 28, 2011
  15. Erik Faye-LundApr 28, 2011
  16. Ingo MolnarApr 28, 2011
  17. Ingo MolnarApr 28, 2011
  18. Erik Faye-LundApr 28, 2011
  19. Pekka EnbergApr 28, 2011
  20. Erik Faye-LundApr 28, 2011
  21. Pekka EnbergApr 28, 2011
  22. Erik Faye-LundApr 28, 2011
  23. Pekka EnbergApr 28, 2011
  24. Jonathan NiederApr 28, 2011
  25. Erik Faye-LundApr 28, 2011
  26. Ingo MolnarApr 28, 2011
  27. Ingo MolnarApr 28, 2011
  28. Erik Faye-LundApr 28, 2011
  29. Ingo MolnarApr 28, 2011
  30. Alex RiesenApr 29, 2011
  31. H. Peter AnvinApr 29, 2011
  32. Tor ArntsenApr 28, 2011
  33. H. Peter AnvinApr 28, 2011
  34. Andreas EricssonApr 28, 2011
  35. Erik Faye-LundApr 28, 2011
  36. Ingo MolnarApr 28, 2011
  37. Nguyen Thai Ngoc DuyApr 28, 2011
  38. Erik Faye-LundApr 28, 2011
  39. Junio C HamanoApr 28, 2011
  40. Dmitry PotapovApr 28, 2011
  41. Dmitry PotapovApr 28, 2011
  42. Ingo MolnarApr 28, 2011
  43. Dmitry PotapovApr 28, 2011
  44. Ingo MolnarApr 28, 2011
  45. Ingo MolnarApr 28, 2011

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.