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

Re: [PATCH WIP] sha1-lookup: make selection of 'middle' less aggressive

From
Jeff King <peff@peff.net>
Date
Jan 1, 2008, 06:36 UTC
Message-ID
<20080101063616.GA21605@coredump.intra.peff.net>
In-Reply-To
<alpine.LFD.1.00.0712311232520.32517@woody.linux-foundation.org>
On Mon, Dec 31, 2007 at 12:37:36PM -0800, Linus Torvalds wrote:
Show 5 quoted lines
> And quite honestly I'm not really even sure that the performance downside 
> is entirely about zlib itself: I suspect a lot of the reason zlib shows up 
> in the profiles is that the source data is usually cold in the cache, so 
> it probably takes a lot of cache misses (it also will take all the page 
> faults!).

zlib makes a noticeable impact in real world cases. On a git.git repo, fully packed with stock config, warm cache:

  $ /usr/bin/time git whatchanged >/dev/null
  4.12user 0.37system 0:04.50elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
  0inputs+0outputs (0major+6452minor)pagefaults 0swaps
  $ git config pack.compression 0
  $ git repack -a -d -f
  $ /usr/bin/time git whatchanged >/dev/null
  2.93user 0.43system 0:03.36elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k
  0inputs+0outputs (0major+8501minor)pagefaults 0swaps

More pagefaults, but a 25% improvement in wall clock time. The packfile is noticeably larger (55M versus 40M), so I'm sure the cold cache case sucks. It may also change with larger repos, where the packfile size difference kills your cache.

-Peff
Previous: Marco CostalbaNext: Marco Costalba
Message 11 of 14 in “sha1-lookup: more memory efficient search in sorted list of SHA-1”
  1. sha1-lookup: more memory efficient search in sorted list of SHA-1Junio C Hamano, Dec 30, 2007
  2. sha1-lookup: make selection of 'middle' less aggressiveJunio C Hamano, Dec 30, 2007
  3. Marco CostalbaDec 30, 2007
  4. Marco CostalbaDec 30, 2007
  5. Shawn O. PearceDec 31, 2007
  6. Linus TorvaldsDec 30, 2007
  7. Junio C HamanoDec 30, 2007
  8. Marco CostalbaDec 30, 2007
  9. Linus TorvaldsDec 31, 2007
  10. Marco CostalbaDec 31, 2007
  11. Jeff KingJan 1, 2008
  12. Marco CostalbaJan 1, 2008
  13. Marco CostalbaJan 1, 2008
  14. Pierre HabouzitJan 1, 2008

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.