px
px
border
px
   
px
div
Information
null.gif Home

null.gif News
 Topics
 Stories Archive
null.gif Content
 Articles
 Tutorials
 Downloads
 Web Links
 Forums
null.gif Other Stuff
interdit Feedback
 Recommend Us
 Statistics
 Search
 RSS
 Your Account

Digital Video
Installing MythTV
MythWeb Hacks
Remote Control
Hardware Kit
Complete System

Digital Surveillance
Installing Zoneminder
Hardware Kit

VIA EPIA
Comparison Chart
Performance
Optimizing

Store Information
Shipping & Returns
Privacy Notice
Conditions of Use
Contact Us

div
  TopMy Account  |  Cart Contents  |  Checkout   
Compiler Optimization for the VIA EPIA Mainboard


Page: 1/4

Our favorite Linux distribution for the VIA EPIA mainboards is Gentoo. Gentoo gives us the ability to customize and optimize the Linux installation for our specific hardware and needs. Since Gentoo builds the system from source code, we have the ability to specify the compiler flags used to build the system. Specifically we will focus on the -O or "optimization" compiler flag. However there is some disagreement about what optimization works best for the VIA Eden/C3 CPU's. In this article we hope to shed some light on this issue.

If you've ever installed Gentoo you're no doubt familiar with the /etc/make.conf file. Among other things you can use it to specify the compiler flags used to build the system. The site www.epiawiki.org (a great source of information for using Gentoo on the VIA EPIA mainboard) recommends the following for the ME-6000 mainboard:

CFLAGS = -march=i586 -m3dnow -O2 -pipe -fomit-frame-pointer CHOST = i586-pc-linux-gnu

However, Mr Rroet suggests one may realize better performance with the -Os flag. He writes:

“Why -Os? Because -O2 and -O3 make your binaries bigger. Further the C3 processors have a very small cache (64kb). If you'd use -O2 and -O3 you'll have some features in there that will flood the cache. Same as using -funroll-loops it will flood the cache as well.“

So which optimization flag is best? Let's find out.

About the Hardware

For this test we will use the following hardware:

  • VIA EPIA ME-6000 Mainboard
  • 256 mb PC2100 RAM
  • 80 gb Seagate Barracuda Hard Drive
  • CD-ROM Drive
About Compiler Optimization

As we mentioned earlier, Gentoo lets you set the compiler flags we use to build the system. This is the -O or “Optimization” flag. The GCC (GNU Compiler Collection) tells us the following:
-O or -O1
Optimize. Optimizing compilation takes somewhat more time, and a lot more memory for a large function.

With -O, the compiler tries to reduce code size and execution time, without performing any optimizations that take a great deal of compilation time.

-O turns on the following optimization flags:


          -fdefer-pop 
          -fmerge-constants 
          -fthread-jumps 
          -floop-optimize 
          -fif-conversion 
          -fif-conversion2 
          -fdelayed-branch 
          -fguess-branch-probability 
          -fcprop-registers
     
-O also turns on -fomit-frame-pointer on machines where doing so does not interfere with debugging.

-O2
Optimize even more. GCC performs nearly all supported optimizations that do not involve a space-speed trade off. The compiler does not perform loop unrolling or function inlining when you specify -O2. As compared to -O, this option increases both compilation time and the performance of the generated code.

-O2 turns on all optimization flags specified by -O. It also turns on the following optimization flags:


          -fforce-mem 
          -foptimize-sibling-calls 
          -fstrength-reduce 
          -fcse-follow-jumps  -fcse-skip-blocks 
          -frerun-cse-after-loop  -frerun-loop-opt 
          -fgcse  -fgcse-lm  -fgcse-sm  -fgcse-las 
          -fdelete-null-pointer-checks 
          -fexpensive-optimizations 
          -fregmove 
          -fschedule-insns  -fschedule-insns2 
          -fsched-interblock  -fsched-spec 
          -fcaller-saves 
          -fpeephole2 
          -freorder-blocks  -freorder-functions 
          -fstrict-aliasing 
          -funit-at-a-time 
          -falign-functions  -falign-jumps 
          -falign-loops  -falign-labels 
          -fcrossjumping
     
Please note the warning under -fgcse about invoking -O2 on programs that use computed gotos.

-O3
Optimize yet more. -O3 turns on all optimizations specified by -O2 and also turns on the -finline-functions, -fweb and -frename-registers options.

-O0
Do not optimize. This is the default.

-Os
Optimize for size. -Os enables all -O2 optimizations that do not typically increase code size. It also performs further optimizations designed to reduce code size.

-Os disables the following optimization flags:


          -falign-functions  -falign-jumps  -falign-loops 
          -falign-labels  -freorder-blocks  -fprefetch-loop-arrays
     
If you use multiple -O options, with or without level numbers, the last such option is the one that is effective.
The Gentoo compiler flags are specified in the /etc/make.conf file. These flags are used when you install utilities and applications. They are not used when you compile the kernel. The rational is the kernel has more stringent compiler setting requirements than applications. A more complete discussion can be found in the Gentoo forums.

For this test we want to see how the optimization impacts the kernel as well. To do this we set the CFLAGS_KERNEL environment variable in /usr/src/linux/Makefile to the same -O setting used in make.conf.




Next Page (2/4) Next Page


div
Survey
Are you doing a Car-PC project?

Yes, active now
Yes, planning stage
Thinking about it
No, not interested



Results
Polls

Votes: 328
Comments: 0

Login
Login Name

Password

Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.

Who's Online
There are currently, 9 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here

div



MagicITX Logo © 2004.
All other logos and trademarks in this site are property of their respective owner. Comments are the property of their poster.
PHP-Nuke Copyright © 2005 by Francisco Burzi. This is free software and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty for details see the license.
Page Generation: 0.125 Seconds