develooper Front page | perl.perl5.porters | Postings from February 2003

Re: -Os for Darwin why?

Thread Previous | Thread Next
From:
schwern
Date:
February 17, 2003 19:15
Subject:
Re: -Os for Darwin why?
Message ID:
20030217191403.A17553@ttul.org
On Mon, Feb 17, 2003 at 06:29:34PM -0800, Wilfredo Sánchez wrote:
>    Why do you think -Os is broken?
>
>    Optimizing for size also mean less resident memory usage on the part 
> of Perl.  Apple asserts that this is a more important optimization than 
> saving on CPU cycles.  Given that memory speed has not increased at 
> pace with CPU speed over time (on any platform), this is probably a 
> reasonable assertion.
> 
>    If you disagree, that's why you can override things.
> 
>    I don't follow where you conclude that the compiler must be broken 
> due to this decision.

I've never seen anything use -Os as a default before and the hint file 
logic in darwin.sh of using -O3 for 5.X and down and -Os for 6.X and up is
usually used to avoid broken compilers.  I couldn't think of any other
reason why you'd use -Os just then and there's no explaination in the
hint file (patch follows).

Also, OS X has shipped busted versions of gcc and libraries in the past
and is using prerelease versions of gcc 3.1.  Always a warning sign.

Also when I compiled with -O3 miniperl segfaulted while generating the
Encode cp* files.  But I re-ran with -Os and got the same problem.  It
could be that I'm using -L/sw/lib (ie. fink) to get gdbm and db.  
I'll try removing that next and see what happens.  Still tracking the
problem down.

So chaulk it up to surprise and past experiences.  Your logic for using -Os 
is as good as any other.  Compiler voodoo is beyond me.

Why is -Os used only for 6.x and up and -O3 for 5.x and down?


--- hints/darwin.sh	2003/02/18 03:12:09	1.1
+++ hints/darwin.sh	2003/02/18 03:12:54
@@ -52,7 +52,11 @@
 # nm works.
 usenm='true';
 
-# Optimize.
+#    Optimizing for size also mean less resident memory usage on the part
+# of Perl.  Apple asserts that this is a more important optimization than
+# saving on CPU cycles.  Given that memory speed has not increased at
+# pace with CPU speed over time (on any platform), this is probably a
+# reasonable assertion.
 if [ -z "${optimize}" ]; then
   case "$osvers" in
     [12345].*) optimize='-O3' ;;


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About