CFLAGS shave 1.5 seconds off boot

I spent the past day rebuilding another Crux system on my Thinkpad, this time with more CFLAGS that were more … aggressive? Ordinarily, I stick with the “safe” ones listed on the Gentoo wiki, which are:

export CHOST="i686-pc-linux-gnu"
export CARCH="i686"
export CFLAGS="-O2 -march=pentium3 -pipe -fomit-frame-pointer"
export CXXFLAGS="-O2 -march=pentium3 -pipe -fomit-frame-pointer"

in my /etc/pkgmk.conf file. This time I went with

export CHOST="i686-pc-linux-gnu"
export CARCH="i686"
export CFLAGS="-Os -march=pentium3 -pipe -ffast-math -fomit-frame-pointer"
export CXXFLAGS="-Os -march=pentium3 -pipe -ffast-math -fomit-frame-pointer"

The net result was to cut almost a second and a half off my boot time, from just under 17 seconds to exactly 15.5. Not bad for a 550Mhz Celeron with only 192Mb of PC100. The working environment is very snappy too — software seems to start a little quicker, and some of the “laggy” sensation that sometimes accompanies programs seems to have lessened.

Overall, I’m satisfied with the results, even if most discussions as well as the documentation for gcc suggest those settings are less than kosher. Everything installed without incident, and nothing is freezing or crashing. I did notice that some of the packages compiled with settings that seemed to override the ones I had set in pkgmk.conf, so it’s possible the software designers know which flags are better than me.

And I’m happy to defer to their expertise on that point. :D

In the mean time though, I’m going to keep tweaking and see what else I can come up with.

About these ads

3 Responses to “CFLAGS shave 1.5 seconds off boot”

  1. 1 infinitycircuit 2008/06/08 at 2:15 PM

    I have a question. How does one rebuild a CRUX system after changing CFLAGS? I remember from the days of Gentoo that you could run emerge -uavD world, but I don’t see any equivalent command in the CRUX documentation.

  2. 2 infinitycircuit 2008/06/08 at 2:57 PM

    Nevermind, I answered my own question by looking in the “advanced” section of the prt-get start guide. The command is:

    prt-get listinst|xargs prt-get update --margs="-f" --log

  3. 3 K.Mandla 2008/06/08 at 5:24 PM

    Ooh, thanks for that. I was just thinking about that the other day and wondering if the entire system on one machine could be hopscotched to a new set of compile flags, or if I’d have to rebuild from scratch. Thanks for saving me the legwork. I’m going to get started on that tonight. Cheers! :D :D :D

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Visit the Wiki!

Some recent desktops

May 6, 2011
Musca 0.9.24 on Crux Linux
150Mhz Pentium 96Mb 8Gb CF

May 14, 2011
IceWM 1.2.37 and Arch Linux
L2300 core duo 3Gb 320Gb

Some recent games

Apr. 21, 2011
Oolite on Xubuntu 11.04
L2300 core duo 3Gb 320Gb

Enter your email address to subscribe to this blog and receive notifications of new posts.

Join 405 other followers


This work is licensed under the GNU Free Documentation License. Please see the About page for details.

Blog Stats

  • 3,960,053 hits



Get every new post delivered to your Inbox.

Join 405 other followers

%d bloggers like this: