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

Re: Shrink the git binary a bit by avoiding unnecessary inline functions

From
Christian MICHON <christian.michon@gmail.com>
Date
Jun 22, 2008, 21:32 UTC
Message-ID
<46d6db660806221432m6a6e2f3egf78faa1510f8d643@mail.gmail.com>
In-Reply-To
<alpine.LFD.1.10.0806221159140.2926@woody.linux-foundation.org>

On Sun, Jun 22, 2008 at 9:19 PM, Linus Torvalds <torvalds@linux-foundation.org> wrote:

Show 6 quoted lines
>
> So I was looking at the disgusting size of the git binary, and even with
> the debugging removed, and using -Os instead of -O2, the size of the text
> section was pretty high. In this day and age I guess almost a megabyte of
> text isn't really all that surprising, but it still doesn't exactly make
> me think "lean and mean".

using gcc-3.4.6 and uclibc-0.9.29 (not exactly everyone's configuration of course...) I get different numbers with CFLAGS=-Os and NO_CURL, NO_ICONV on plain git-1.5.6:

sh-3.2# ls -lh git -rwxr-xr-x 3 root root 699.7k Jun 22 23:26 git

sh-3.2# size git
   text    data     bss     dec     hex filename
 616544   10960  272272  899776   dbac0 git
after I use your patch, it goes to:

sh-3.2# ls -lh git -rwxr-xr-x 1 root root 652.6k Jun 22 23:30 git

sh-3.2# size git
   text    data     bss     dec     hex filename
 568124   10960  272272  851356   cfd9c git
So your patch obviously works here too but I get quite smaller figures too.

curl and iconv are not available on my distro detaolb, maybe it's a big difference too...

Could your figures come from recent gcc/glibc versions ?
-- 
Christian
--
http://detaolb.sourceforge.net/, a linux distribution for Qemu with Git inside !
Previous: Linus TorvaldsNext: Christian MICHON
Message 2 of 7 in “Shrink the git binary a bit by avoiding unnecessary inline functions”
  1. Linus TorvaldsJun 22, 2008
  2. Christian MICHONJun 22, 2008
  3. Christian MICHONJun 23, 2008
  4. Linus TorvaldsJun 23, 2008
  5. Christian MICHONJun 23, 2008
  6. Matthieu MoyJun 22, 2008
  7. Linus TorvaldsJun 22, 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.