UNIX Socket FAQ

A forum for questions and answers about network programming on Linux and all other Unix-like systems

You are not logged in.

  • Index
  • » C++
  • » pentium 4 g++ (first Im first!!!!!)

#1 2003-06-27 03:09 PM

emihaly
Member
Registered: 2002-08-01
Posts: 191

Re: pentium 4 g++ (first Im first!!!!!)

i use Pentium4 3.06GHZ with hyperthreading and SMP RedHat 9. What is best swichs for g++ compiler for best performance under this system?

i use g++ -o -O2 output input.cpp

Offline

#2 2003-06-29 11:46 PM

mlampkin
Administrator
From: Sol 3
Registered: 2002-06-12
Posts: 911
Website

Re: pentium 4 g++ (first Im first!!!!!)

If you want the code 100% optimized for the pentium 4 processor then try adding:

-march=pentium4 -fomit-frame-pointer

You should note that the use of -march will result in code that probably will not run on ANY other processor (unless the processor is the next generation and is 100% instruction compatible with the p4)...

If you don't want that sort of situation... then replace -march with -mcpu leaving the rest of the line as before...  this will / should cause optimizations without causing a break down on other (previous versions of the same family) cpus...

Side note... you may not actually need the -fomit-frame-pointer flag...  not all the way certain with the -O2 (or -O3) flags... may include / set it by default when they are used... but explicitly declaring them certainly won't hurt anything...

Michael


"The only difference between me and a madman is that I'm not mad."

Salvador Dali (1904-1989)

Offline

  • Index
  • » C++
  • » pentium 4 g++ (first Im first!!!!!)

Board footer

Powered by FluxBB