OVH Cloud OVH Cloud

Re: [gentoo-user-fr] Optimisation

1 réponse
Avatar
Bernard Stephan
------_=_NextPart_001_01C51F2D.A7416F80
Content-Type: text/plain;
charset="ISO-8859-15"
Content-Transfer-Encoding: quoted-printable

J'ai lu le fil de discussion en diagonale, mais il me semble que=20
l'option -s (Remove all symbol table and relocation information from =
the=20
executable) a =E9t=E9 oubli=E9e. Or elle r=E9duit consid=E9rablement la =
taille de=20
l'ex=E9cutable.

Il y a peu, cette option n'=E9tait pas compatible avec l'option -O3, =
c'est=20
=E0 dire que gcc -O3 -s se comportait comme gcc -O2 -s. Or depuis peu, =
ce=20
n'est plus le cas.

J'ai test=E9 ces deux options avec le benchmark de=20
http://gentoofr.org/article.php3?id_article=3D59 (petit en taille), et =
-O3=20
-s est plus rapide que -O2 -s. Or, d'exp=E9rience, -O3 -s est bien plus =

petit que -O3 seul, et du m=EAme ordre de grandeur que -O2 -s (mais il =
est=20
vrai que je n'ai pas beaucoup test=E9 sur de tr=E8s grands =
ex=E9cutables --=20
bienvenu aux retours d'exp=E9rience dans ce contexte).

Conclusion perso : CFLAGS=3D"-march=3Dpentium4 -O3 -s -pipe=20
-fomit-frame-pointer"
--=20
St=E9phan BERNARD

Yoann Pannier wrote:

> NiCoS wrote:
> >>O3 =3D> binaires plus gros =3D> chargements plus long.
> >
> > Hmm est-ce =E0 dire qu'il faudrait compiler en -O2 par ex ou autre =
?=20
> Quel est
> > l'avantage/l'inconv=E9nient par rapport =E0 -O3 ?
>
> Ca d=E9pend ;)
>
> Je suis loin d'=EAtre un expert en la mati=E8re, mais disons qu'un =
binaire
> (...)
>
> Ma conclusion personnelle, =E0 ma situation personnelle est :
> CFLAGS=3D"-march=3Dpentium4 -O2 -pipe -fomit-frame-pointer"
>
> Voili Voilou, si j'ai dit trop de b=EAtises, oubliez les !
>
> --=20
> Yoann Pannier
>
> --=20
> gentoo-user-fr@gentoo.org mailing list
>


------_=_NextPart_001_01C51F2D.A7416F80
Content-Type: text/html;
charset="ISO-8859-15"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3DISO-8859-15">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2653.12">
<TITLE>Re: [gentoo-user-fr] Optimisation</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2>J'ai lu le fil de discussion en diagonale, mais il me =
semble que </FONT>
<BR><FONT SIZE=3D2>l'option -s (Remove all symbol table and relocation =
information from the </FONT>
<BR><FONT SIZE=3D2>executable) a =E9t=E9 oubli=E9e. Or elle r=E9duit =
consid=E9rablement la taille de </FONT>
<BR><FONT SIZE=3D2>l'ex=E9cutable.</FONT>
</P>

<P><FONT SIZE=3D2>Il y a peu, cette option n'=E9tait pas compatible =
avec l'option -O3, c'est </FONT>
<BR><FONT SIZE=3D2>=E0 dire que gcc -O3 -s se comportait comme gcc -O2 =
-s. Or depuis peu, ce </FONT>
<BR><FONT SIZE=3D2>n'est plus le cas.</FONT>
</P>

<P><FONT SIZE=3D2>J'ai test=E9 ces deux options avec le benchmark de =
</FONT>
<BR><FONT SIZE=3D2><A =
HREF=3D"http://gentoofr.org/article.php3?id_article=3D59" =
TARGET=3D"_blank">http://gentoofr.org/article.php3?id_article=3D59</A> =
(petit en taille), et -O3 </FONT>
<BR><FONT SIZE=3D2>-s est plus rapide que -O2 -s. Or, d'exp=E9rience, =
-O3 -s est bien plus </FONT>
<BR><FONT SIZE=3D2>petit que -O3 seul, et du m=EAme ordre de grandeur =
que -O2 -s (mais il est </FONT>
<BR><FONT SIZE=3D2>vrai que je n'ai pas beaucoup test=E9 sur de tr=E8s =
grands ex=E9cutables -- </FONT>
<BR><FONT SIZE=3D2>bienvenu aux retours d'exp=E9rience dans ce =
contexte).</FONT>
</P>

<P><FONT SIZE=3D2>Conclusion perso : CFLAGS=3D&quot;-march=3Dpentium4 =
-O3 -s -pipe </FONT>
<BR><FONT SIZE=3D2>-fomit-frame-pointer&quot;</FONT>
<BR><FONT SIZE=3D2>-- </FONT>
<BR><FONT SIZE=3D2>St=E9phan BERNARD</FONT>
</P>

<P><FONT SIZE=3D2>Yoann Pannier wrote:</FONT>
</P>

<P><FONT SIZE=3D2>&gt; NiCoS wrote:</FONT>
<BR><FONT SIZE=3D2>&gt; &gt;&gt;O3 =3D&gt; binaires plus gros =3D&gt; =
chargements plus long.</FONT>
<BR><FONT SIZE=3D2>&gt; &gt;</FONT>
<BR><FONT SIZE=3D2>&gt; &gt; Hmm est-ce =E0 dire qu'il faudrait&nbsp; =
compiler en -O2 par ex ou autre ? </FONT>
<BR><FONT SIZE=3D2>&gt; Quel est</FONT>
<BR><FONT SIZE=3D2>&gt; &gt; l'avantage/l'inconv=E9nient par rapport =
=E0 -O3 ?</FONT>
<BR><FONT SIZE=3D2>&gt;</FONT>
<BR><FONT SIZE=3D2>&gt; Ca d=E9pend ;)</FONT>
<BR><FONT SIZE=3D2>&gt;</FONT>
<BR><FONT SIZE=3D2>&gt; Je suis loin d'=EAtre un expert en la =
mati=E8re, mais disons qu'un binaire</FONT>
<BR><FONT SIZE=3D2>&gt; (...)</FONT>
<BR><FONT SIZE=3D2>&gt;</FONT>
<BR><FONT SIZE=3D2>&gt; Ma conclusion personnelle, =E0 ma situation =
personnelle est :</FONT>
<BR><FONT SIZE=3D2>&gt; CFLAGS=3D&quot;-march=3Dpentium4 -O2 -pipe =
-fomit-frame-pointer&quot;</FONT>
<BR><FONT SIZE=3D2>&gt;</FONT>
<BR><FONT SIZE=3D2>&gt; Voili Voilou, si j'ai dit trop de b=EAtises, =
oubliez les !</FONT>
<BR><FONT SIZE=3D2>&gt;</FONT>
<BR><FONT SIZE=3D2>&gt; -- </FONT>
<BR><FONT SIZE=3D2>&gt; Yoann Pannier</FONT>
<BR><FONT SIZE=3D2>&gt;</FONT>
<BR><FONT SIZE=3D2>&gt; -- </FONT>
<BR><FONT SIZE=3D2>&gt; gentoo-user-fr@gentoo.org mailing list</FONT>
<BR><FONT SIZE=3D2>&gt;</FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01C51F2D.A7416F80--

1 réponse

Avatar
Frédéric Grosshans
Le mercredi 02 mars 2005 à 14:41 +0100, Bernard Stephan a écrit :
J'ai lu le fil de discussion en diagonale, mais il me semble que
l'option -s (Remove all symbol table and relocation information from
the
executable) a été oubliée. Or elle réduit considérablement la taille
de
l'exécutable.




Puisque tu as l'air de connaître les CFLAGS, j'ai une question
extrêmement basique à ce sujet: si je change les CFLAGS de make.conf et
que je ne fait rien d'autre, il n'y a aucun danger ? (c'est à dire que
ça n'a aucun effet négatif, et que mon système se remettra petit à petit
à jour)

Quelles packages dois-je recompiler pour en bénéficier au maximum pour
le minimum d'effort ? 'emerge system && revdep-rebuild' ?

Fred



--
Frédéric Grosshans


--
mailing list