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

Re: gc --aggressive

From
Jeff King <peff@peff.net>
Date
May 1, 2012, 19:35 UTC
Message-ID
<20120501193537.GA26245@sigill.intra.peff.net>
In-Reply-To
<alpine.LFD.2.02.1205011348090.21030@xanadu.home>
On Tue, May 01, 2012 at 01:59:08PM -0400, Nicolas Pitre wrote:
Show 5 quoted lines
> One final quick test if you feel like it: I've never been sure that 
> the last comparison in type_size_sort() is correct.  Maybe it should be 
> the other way around.  Currently it reads:
> 
> 	return a < b ? -1 : (a > b);

I think it is right. At least it should put recent things near the front of the array, just as we are putting bigger things there.

Show 11 quoted lines
> >   orig | 31.4M (100%) |   54s (100%)
> >     10 | 44.0M (140%) |  169s (310%)
> >     20 | 37.7M (120%) |  232s (428%)
> >     40 | 33.6M (107%) |  331s (608%)
> >     80 | 30.9M ( 99%) |  473s (868%)
> >    160 | 29.4M ( 94%) |  696s (1279%)
> [...]
> While keeping the size comparison commented out, you could try to 
> replace this line with:
> 
> 	return b < a ? -1 : (b > a);

No, it's not better. A few of the pack sizes are better, but some of them are worse. And the CPU times are still quite bad. Here are the numbers:

  orig | 31.4M (100%) |   54s (100%)
    10 | 45.6M (145%) |  158s (292%)
    20 | 39.2M (125%) |  205s (377%)
    40 | 35.1M (112%) |  275s (505%)
    80 | 32.4M (103%) |  388s (713%)
   160 | 30.6M ( 98%) |  581s (1067%)
-Peff
Previous: Jeff KingNext: Nicolas Pitre
Message 15 of 26 in “gc --aggressive”
  1. Jay SoffianApr 17, 2012
  2. Jay SoffianApr 17, 2012
  3. Matthieu MoyApr 17, 2012
  4. Jeff KingApr 17, 2012
  5. Jeff KingApr 28, 2012
  6. Nicolas PitreApr 28, 2012
  7. Jeff KingApr 29, 2012
  8. Nicolas PitreApr 29, 2012
  9. Jeff KingMay 1, 2012
  10. Jeff KingMay 1, 2012
  11. Nicolas PitreMay 1, 2012
  12. Junio C HamanoMay 1, 2012
  13. Nicolas PitreMay 1, 2012
  14. Jeff KingMay 1, 2012
  15. Jeff KingMay 1, 2012
  16. Nicolas PitreMay 1, 2012
  17. Nicolas PitreMay 1, 2012
  18. Jeff KingMay 1, 2012
  19. Nicolas PitreMay 1, 2012
  20. Nicolas PitreApr 28, 2012
  21. Jeff KingApr 17, 2012
  22. Junio C HamanoApr 17, 2012
  23. Jeff KingApr 17, 2012
  24. Junio C HamanoApr 17, 2012
  25. Nicolas PitreApr 28, 2012
  26. Andreas EricssonApr 18, 2012

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.