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. 😀

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


3 thoughts on “CFLAGS shave 1.5 seconds off boot

  1. infinitycircuit

    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. infinitycircuit

    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. K.Mandla Post author

    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! 😀 😀 😀


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 )

Facebook photo

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

Connecting to %s