Git development
 help / color / mirror / Atom feed
From: "Christian MICHON" <christian.michon@gmail.com>
To: "Linus Torvalds" <torvalds@linux-foundation.org>
Cc: "Junio C Hamano" <gitster@pobox.com>,
	"Git Mailing List" <git@vger.kernel.org>
Subject: Re: Shrink the git binary a bit by avoiding unnecessary inline functions
Date: Mon, 23 Jun 2008 01:01:46 +0000	[thread overview]
Message-ID: <46d6db660806221801j7207e6b0sdf91c2243fad5349@mail.gmail.com> (raw)
In-Reply-To: <46d6db660806221432m6a6e2f3egf78faa1510f8d643@mail.gmail.com>

On Sun, Jun 22, 2008 at 9:32 PM, Christian MICHON
<christian.michon@gmail.com> wrote:
> 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 ?
>

Linus,

I've put my hands on a usb stick with ubuntu (gcc-4.2.3 and
glibc-2.7), containing all packages needed for a pristine compilation
of git-1.5.6.

I only changed CFLAGS to -Os, no debug info compiled.

ubuntu@ubuntu:~/Desktop/git-1.5.6$ ls -lh git
-rwxr-xr-x 1 ubuntu ubuntu 718K 2008-06-23 00:47 git

ubuntu@ubuntu:~/Desktop/git-1.5.6$ size git
   text	   data	    bss	    dec	    hex	filename
 616606	   9876	 270812	 897294	  db10e	git

There's more than 80k difference with your figures (I have not even
applied your patch yet).
May I ask which version of gcc you're using ? The numbers you provided
were really with -Os ?

Once your patch is applied, these are the final figures:

ubuntu@ubuntu:~/Desktop/git-1.5.6$ ls -lh git
-rwxr-xr-x 1 ubuntu ubuntu 692K 2008-06-23 00:59 git

ubuntu@ubuntu:~/Desktop/git-1.5.6$ size git
   text	   data	    bss	    dec	    hex	filename
 591554	   9876	 270812	 872242	  d4f32	git

-- 
Christian
--
http://detaolb.sourceforge.net/, a linux distribution for Qemu with Git inside !

  reply	other threads:[~2008-06-23  1:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-22 19:19 Shrink the git binary a bit by avoiding unnecessary inline functions Linus Torvalds
2008-06-22 21:32 ` Christian MICHON
2008-06-23  1:01   ` Christian MICHON [this message]
2008-06-23  4:54     ` Linus Torvalds
2008-06-23  5:26       ` Christian MICHON
2008-06-22 22:20 ` Matthieu Moy
2008-06-22 22:40   ` Linus Torvalds

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46d6db660806221801j7207e6b0sdf91c2243fad5349@mail.gmail.com \
    --to=christian.michon@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox