Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • -O is "default optimization level", which may be -O1, -O2, or -O3, depending on how GCC's set up.

    Also, optimizing interpreters is ery non-trivial, and they don't optimize nearly the same way as other, more straightforward, programs do, so the lack of noticeable difference isn't that surprising.
    • I'm confused then (bear with me - it happens often). According to the gcc docs, "-O" is its own option, separate from "-O0", which is the (factory) default setting. But then, I can't seem to figure out how to tell what the default optimization level is in the first place (assuming it's been changed from -O0).
      • You can check the installed man page for gcc and hope it's up to date. For OS X, -O and -O1 are the same, and it looks the same for my linux box, though whether that's true or not is something else entirely.

        Which optimizations -O turns on for various optimization levels is potentially build and system dependent, just to add some fun into the mix. And, of course, GCC's optimizer gets slowly better over time, so even if the settings are identical you may get different runtimes depending on the version of GCC
  • It's probably all right most of the time. Most likely on well tested platforms like x86 Linux. But by the time you get on to the platforms where gcc is less well tested at all of it's optimsations, you can come across subtle bugs. At least, that's the impressionI get from the very conservative FreeBSD guys. They will not endorse compiling world or kernel with -O2, only -O.

    Ultimately, it's really a user choice though, and not something that should be embedded in a Makefile. If you want all your CPAN d

  • MakeMaker is just following whatever is in your Config.pm which is whatever you decided the optimization level should be when you configured and installed Perl. If you took the default,
    then it comes from whatever configuration hints are available for your OS. Most these days
    use -O2 or -O3. Some, like OS X, choose -Os by default. Others (SCO, IRIX, AU/X) use -O to
    play it safe.

    And if you installed Perl from a vendor (Debian, Redhat, Sun, etc...) they could have changed the default, too.

    Here's my stock p