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
Linus Torvalds <torvalds@linux-foundation.org>
Date
Dec 31, 2007, 20:37 UTC
Message-ID
<alpine.LFD.1.00.0712311232520.32517@woody.linux-foundation.org>
In-Reply-To
<e5bfff550712301404g273dd092w9b36b48d94ed1e70@mail.gmail.com>
On Sun, 30 Dec 2007, Marco Costalba wrote:
> 
> Sorry to ask, but just out of curiosity, what were the reasons to
> choose zlib compression algorithm among the possible ones?
It's out there, it's common, it's stable, and it's very good "on average". 

In other words, other compression methods tend to be worse. No, zlib isn't perfect, but it was the obvious default choice for me (I've used it before, we use it in the kernel, it's usually good enough), and I actually expected the SHA1 to be the bigger expense.

Even today, I don't really know of a better compression choice, despite now being more aware of how critical uncompression performance is.

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!).

Quite possibly, the cache miss costs dominate over any algorithmic costs.
		Linus
Previous: Marco CostalbaNext: Marco Costalba
Message 9 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.