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

Re: cloning the kernel - why long time in "Resolving 313037 deltas"

From
Linus Torvalds <torvalds@osdl.org>
Date
Dec 18, 2006, 23:28 UTC
Message-ID
<Pine.LNX.4.64.0612181511260.3479@woody.osdl.org>
In-Reply-To
<8664c896xv.fsf@blue.stonehenge.com>
On Mon, 18 Dec 2006, Randal L. Schwartz wrote:
Show 5 quoted lines
> 
> Linus> You're running this under OS X, aren't you? It's a pig of an OS, but 
> Linus> "almost one hour" vs "25 seconds" is still unreasonable.
> 
> I agree!
The only thing that comes to mind is
 - some actual difference in how the pack looks. Although I don't really 
   see that. I re-pack both my own private kernel repos and the kernel.org 
   one fairly often, and usually with a pretty recent git. I don't think 
   any of the packing heuristics have changed in a long time. And I just 
   checked: the kernel.org pack-file (the big one) unpacks quickly too.
 - SHA1 library differences. Maybe OpenSSL on OS X sucks? I still don't 
   see the difference being _that_ big, but whatever..
 - OS X "mmap()" performance really really sucks.
   We do end up doing a _log_ of small mmaps in the "Resolving .." stage. 
   On Linux, the strace looks like
	write(2, "Resolving 316071 deltas.\n", 25) = 25
	mmap(NULL, 2619, PROT_READ, MAP_PRIVATE, 3, 0x4c000) = 0x2aaf13be2000
	munmap(0x2aaf13be2000, 2619)            = 0
	mmap(NULL, 2848, PROT_READ, MAP_PRIVATE, 3, 0x4c000) = 0x2aaf13be2000
	munmap(0x2aaf13be2000, 2848)            = 0
	mmap(NULL, 2988, PROT_READ, MAP_PRIVATE, 3, 0x4c000) = 0x2aaf13be2000
	munmap(0x2aaf13be2000, 2988)            = 0
	write(2, "   0% (2/316071) done\r", 22) = 22
	mmap(NULL, 3336, PROT_READ, MAP_PRIVATE, 3, 0x4c000) = 0x2aaf13be2000
	munmap(0x2aaf13be2000, 3336)            = 0
	mmap(NULL, 3471, PROT_READ, MAP_PRIVATE, 3, 0x4c000) = 0x2aaf13be2000
	munmap(0x2aaf13be2000, 3471)            = 0
	mmap(NULL, 3611, PROT_READ, MAP_PRIVATE, 3, 0x4c000) = 0x2aaf13be2000
	munmap(0x2aaf13be2000, 3611)            = 0
	...
   and it's entirely possible that mmap() really does suck *ss on OS X. 
   Those small mmap's go on for a _loong_ time.

I've heard of other operations being slow on OS X - and two orders of magnitude really isn't unthinkable. I don't think people always seem to really understand how _good_ Linux is, and how much faster it can be. It's not just "Windows XP" sucks. Quite often it's literally "Linux is just damn fast".

Sadly, that causes problems when the main developers don't even see any issues, just because the Linux kernel environment makes things look really really cheap. Even when it isn't always cheap on other platforms.

Nico - have you looked at perhaps making the index-pack.c "mmap()" usage do chunking? Or just mmap the whole damn thing once? Linux is fast, but even Linux will be faster if you just mmap it once ;)

Previous: Andreas EricssonNext: Nicolas Pitre
Message 14 of 51 in “Re: [PATCH] fetch-pack: avoid fixing thin packs when unnecessary”
  1. Johannes SchindelinDec 18, 2006
  2. Nicolas PitreDec 18, 2006
  3. Randal L. SchwartzDec 18, 2006
  4. Nicolas PitreDec 18, 2006
  5. Randal L. SchwartzDec 18, 2006
  6. Nicolas PitreDec 18, 2006
  7. Linus TorvaldsDec 18, 2006
  8. Randal L. SchwartzDec 18, 2006
  9. Martin LanghoffDec 18, 2006
  10. Kyle MoffettDec 22, 2006
  11. Shawn PearceDec 22, 2006
  12. Marco RoelandDec 22, 2006
  13. Andreas EricssonJan 3, 2007
  14. Linus TorvaldsDec 18, 2006
  15. Nicolas PitreDec 19, 2006
  16. Theodore TsoDec 19, 2006
  17. Shawn PearceDec 19, 2006
  18. Linus TorvaldsDec 19, 2006
  19. Shawn PearceDec 19, 2006
  20. Marco RoelandDec 19, 2006
  21. Shawn PearceDec 19, 2006
  22. Shawn PearceDec 19, 2006
  23. Marco RoelandDec 19, 2006
  24. Shawn PearceDec 19, 2006
  25. Marco RoelandDec 19, 2006
  26. Alex RiesenDec 19, 2006
  27. Juergen RuehleDec 21, 2006
  28. Theodore TsoDec 19, 2006
  29. Linus TorvaldsDec 19, 2006
  30. Shawn PearceDec 20, 2006
  31. Shawn PearceDec 20, 2006
  32. Linus TorvaldsDec 19, 2006
  33. Johannes SchindelinDec 19, 2006
  34. Junio C HamanoDec 19, 2006
  35. Jeff KingDec 19, 2006
  36. Andy WhitcroftDec 19, 2006
  37. index-pack usage of mmap() is unacceptably slower on many OSes other than LinuxNicolas Pitre, Dec 19, 2006
  38. Junio C HamanoDec 19, 2006
  39. Nicolas PitreDec 19, 2006
  40. Linus TorvaldsDec 19, 2006
  41. Randal L. SchwartzDec 19, 2006
  42. Randal L. SchwartzDec 19, 2006
  43. Jeff GarzikDec 19, 2006
  44. Junio C HamanoDec 20, 2006
  45. Linus TorvaldsDec 20, 2006
  46. Jeff GarzikDec 20, 2006
  47. Junio C HamanoDec 20, 2006
  48. Junio C HamanoDec 20, 2006
  49. Linus TorvaldsDec 20, 2006
  50. Junio C HamanoDec 20, 2006
  51. Nikolai WeibullDec 20, 2006

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.