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
Shawn O. Pearce <spearce@spearce.org>
Date
Dec 31, 2007, 22:40 UTC
Message-ID
<20071231224015.GW14735@spearce.org>
In-Reply-To
<e5bfff550712301106l133dd38btd2cc4be02159387d@mail.gmail.com>
Marco Costalba <mcostalba@gmail.com> wrote:
Show 15 quoted lines
> Just for document the profiling I have uploaded a snapshot of
> KCachegrind profiling data on a run of git-log on the git tree:
> 
> http://digilander.libero.it/mcostalba/callgrind_git_log1.png
> 
> From there you can see that pretty.c and strbuf.c, after all the
> optimizations, account for less then 8% of total time.
> The biggest part is that 86.64% that is due almost entirely to zlib.
> 
> In particular
> 
> st = inflate(&stream, Z_FINISH);
> 
> called from unpack_compressed_entry() in sha1_file.c accounts for 72%
> of total time.

That's one of the areas where packv4 was actually a reasonably good gain. It was faster for packv4 to convert a dict based commit or tree into the canonical raw format used by git than it was for zlib inflate to decompress the very same data.

It wasn't a huge gain, but if I recall we were saving a good half second on a 4 second "git log --raw >/dev/null" time. And that was before we even tried to improve the tree walking APIs to take advantage of the smaller (and easier to read) dict based tree objects.

Linus already mentioned in another reply on this thread that the inflate time may be all page faults. The savings we were seeing from the dict based format may have simply been due to less page faults; the dict based format was slightly smaller so we probably got a lot more in disk cache at once.

-- 
Shawn.
Previous: Marco CostalbaNext: Linus Torvalds
Message 5 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.