Securing and Optimizing Linux:RedHat Edition | All about OS

General System Optimization

Категория: Securing and Optimizing

Step 2
Now after the selection of your CPU settings (i686, i586, or i486) a bit further down in the
“/etc/profile” file, add ” CFLAGS LANG LESSCHARSET” to the “export” line:
export PATH PS1 HOSTNAME HISTSIZE HISTFILESIZE USER LOGNAME MAIL INPUTRC CFLAGS LANG LESSCHARSET
Step 3
Log out and back in; after this, the new CFLAGS environment variable is set, and software and other “configure” tool will recognize that. Pentium (Pro/ll/lll) optimizations will only work with egcs or pgcc compilers. The egcs compiler is already installed on your Server by default so you don’t need to worry about it.
Below is the explanation of the different optimization options we use:
• The “-funroll-loops”
The “-funroll-loops” optimization option will perform the optimization of loop unrolling and will do it only for loops whose number of iterations can be determined at compile time or run time.
• The “-funroll-all-loops”
The “-funroll-all-loops” optimization option will also perform the optimization of loop unrolling and is done for all loops.
• The “-ffast-math”
The “-ffast-math” optimization option will allow the GCC compiler, in the interest of optimizing code for speed, to violate some ANSI or IEEE rules/specifications.
• The “-malign-double”
The “-malign-double” optimization option will control whether the GCC compiler aligns double, long double, and long long variables on a two-word boundary or a one-word boundary. This will produce code that runs somewhat faster on a ‘Pentium’ at the expense of more memory.
• The “-mcpu=cpu_type”
The “-mcpu=cpu_type” optimization option will set the default CPU to use for the machine type when scheduling instructions.
• The “-march=cpu_type”
The “-march=cpu_type” optimization option will generate instructions for the machine and cpu type. Specifying the “-march=cpu_type” option implies also to specify the “-mcpu=cpu_type” option in your compilation.

Страниц: 1 2 3

« Unusual or hidden files
The “bdflush” parameters »