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

Re: Remove diff machinery dependency from read-cache

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 21, 2010, 20:07 UTC
Message-ID
<7vljfrp6g2.fsf@alter.siamese.dyndns.org>
In-Reply-To
<alpine.LFD.2.00.1001211119130.13231@localhost.localdomain>
Linus Torvalds <torvalds@linux-foundation.org> writes:
Show 15 quoted lines
> This trivial cleanup results in pretty stunning file size differences. 
> The diff machinery really is mostly used by just the builtin programs, and 
> you have things like these trivial before-and-after numbers:
>
>   -rwxr-xr-x 1 torvalds torvalds 1727420 2010-01-21 10:53 git-hash-object
>   -rwxrwxr-x 1 torvalds torvalds  940265 2010-01-21 11:16 git-hash-object
>
> Now, I'm not saying that 940kB is good either, but that's mostly all the 
> debug information - you can see the real code with 'size':
>
>    text	   data	    bss	    dec	    hex	filename
>  418675	   3920	 127408	 550003	  86473	git-hash-object (before)
>  230650	   2288	 111728	 344666	  5425a	git-hash-object (after)
>
> ie we have a nice 24% size reduction from this trivial cleanup.

The patch itself to move add_files_to_cache() to builtin-add.c (or to its own file) makes sense from the code placement POV, but if the goal is to shrink the on-disk footprint, isn't an alternative approach be to make hash-object built-in? You can lose the whole 1.7M from the filesystem footprint that way, no?

Previous: Linus TorvaldsNext: Linus Torvalds
Message 2 of 23 in “Remove diff machinery dependency from read-cache”
  1. Linus TorvaldsJan 21, 2010
  2. Junio C HamanoJan 21, 2010
  3. Linus TorvaldsJan 21, 2010
  4. Linus TorvaldsJan 21, 2010
  5. Linus TorvaldsJan 21, 2010
  6. Junio C HamanoJan 22, 2010
  7. Johannes SchindelinJan 22, 2010
  8. Junio C HamanoJan 22, 2010
  9. Johannes SchindelinJan 22, 2010
  10. Junio C HamanoJan 22, 2010
  11. Linus TorvaldsJan 22, 2010
  12. Linus TorvaldsJan 22, 2010
  13. Linus TorvaldsJan 22, 2010
  14. Johannes SixtJan 22, 2010
  15. merge-tree: remove unnecessary call of git_extract_argv0_pathJohannes Sixt, Jan 22, 2010
  16. Linus TorvaldsJan 22, 2010
  17. Nicolas PitreJan 22, 2010
  18. Linus TorvaldsJan 22, 2010
  19. Junio C HamanoJan 22, 2010
  20. Linus TorvaldsJan 22, 2010
  21. Linus TorvaldsJan 22, 2010
  22. Linus TorvaldsJan 22, 2010
  23. Brian CampbellJan 23, 2010

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.