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

Re: git gc --aggressive led to about 40 times slower "git log --raw"

From
CJChristian Jaeger <chrjae@gmail.com>
Date
Feb 18, 2014, 16:43 UTC
Message-ID
<CAEjYwfUfOo1huAJE2oLrMorV0tQy0Y79y2WPGEK8R0T_wq4k9g@mail.gmail.com>
In-Reply-To
<CACsJy8D9tws_gu6yWVdz3t+Vfg5-9iorptn4BLnTL3b+YWcHzQ@mail.gmail.com>
2014-02-18 9:45 GMT+00:00 Duy Nguyen <pclouds@gmail.com>:
> Christian can try "git repack -adf"

That's what I already mentioned in my first mail is what I used to fix the problem.

Here are some 'hard' numbers, FWIW:
- both ~/scr and swap are on the same SSD;
$ free
             total       used       free     shared    buffers     cached
Mem:       3996748    3800828     195920          0     377176    1078848
-/+ buffers/cache:    2344804    1651944
Swap:      2097148     169760    1927388

git only used up to about 100 MB of VIRT or RSS when I checked, there was an ulimit of "-S -v 1200000".

- this is git version 1.7.10.4 (1:1.7.10.4-1+wheezy1 i386 Debian)
- after my attempted merge (which had conflicts and I had then
cancelled by way of git reset --hard), and then a "git gc", the times
were:
~/scr$ time git log --raw > _THELOG

real 3m7.002s user 2m0.252s sys 1m6.008s

- on a copy:

/dev/shm/scr$ time git repack -a -d -f Counting objects: 34917, done. Delta compression using up to 2 threads. Compressing objects: 100% (27038/27038), done. Writing objects: 100% (34917/34917), done. Total 34917 (delta 13928), reused 0 (delta 0)

real 4m33.193s user 3m42.950s sys 1m13.821s

/dev/shm/scr$ time git log --raw > _THELOG2

real 0m8.276s user 0m7.192s sys 0m1.052s

(not sure why it took 8s here, perhaps I had another process running at the same time? Compare with the "0m4.913s" below.)

/dev/shm/scr$ time g-gc --aggressive Counting objects: 36066, done. Delta compression using up to 2 threads. Compressing objects: 100% (27812/27812), done. Writing objects: 100% (36066/36066), done. Total 36066 (delta 14367), reused 21699 (delta 0) Checking connectivity: 36066, done.

real 5m52.013s user 8m28.652s sys 1m4.308s

/dev/shm/scr$ time git log --raw > _THELOG2

real 1m34.430s user 0m47.291s sys 0m46.615s

/dev/shm/scr$ time git repack -adf Counting objects: 36066, done. Delta compression using up to 2 threads. Compressing objects: 100% (27812/27812), done. Writing objects: 100% (36066/36066), done. Total 36066 (delta 14256), reused 21699 (delta 0)

real 2m32.083s user 1m51.295s sys 1m4.940s

/dev/shm/scr$ time git log --raw > _THELOG3

real 0m4.913s user 0m3.944s sys 0m0.944s

/dev/shm/scr$ du -s .git 43728 .git

- back in the original place:

~/scr$ time git repack -a -d -f Counting objects: 36066, done. Delta compression using up to 2 threads. Compressing objects: 100% (27812/27812), done. Writing objects: 100% (36066/36066), done. Total 36066 (delta 14257), reused 21700 (delta 0)

real 4m6.503s user 3m16.568s sys 1m11.640s

~/scr$ time git log --raw > _THELOG2

real 0m5.002s user 0m4.032s sys 0m0.952s

Previous: Andreas Schwab
Message 31 of 31 in “git gc --aggressive led to about 40 times slower "git log --raw"”
  1. Christian JaegerFeb 18, 2014
  2. David KastrupFeb 18, 2014
  3. Duy NguyenFeb 18, 2014
  4. David KastrupFeb 18, 2014
  5. Jonathan NiederFeb 18, 2014
  6. Junio C HamanoFeb 18, 2014
  7. Duy NguyenFeb 18, 2014
  8. Junio C HamanoFeb 19, 2014
  9. Duy NguyenFeb 19, 2014
  10. Philippe VaucherFeb 19, 2014
  11. David KastrupFeb 19, 2014
  12. Duy NguyenFeb 19, 2014
  13. Duy NguyenFeb 19, 2014
  14. Christian JaegerFeb 20, 2014
  15. David KastrupFeb 20, 2014
  16. David KastrupFeb 20, 2014
  17. David KastrupFeb 20, 2014
  18. Junio C HamanoFeb 19, 2014
  19. Duy NguyenFeb 20, 2014
  20. Christian JaegerFeb 21, 2014
  21. Junio C HamanoFeb 21, 2014
  22. Duy NguyenFeb 21, 2014
  23. Junio C HamanoFeb 21, 2014
  24. Philippe VaucherFeb 24, 2014
  25. Duy NguyenFeb 22, 2014
  26. David KastrupFeb 22, 2014
  27. David KastrupFeb 22, 2014
  28. Duy NguyenFeb 22, 2014
  29. Duy NguyenFeb 22, 2014
  30. Andreas SchwabFeb 22, 2014
  31. Christian JaegerFeb 18, 2014

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.