D&C Lug - Home Page
Devon & Cornwall Linux Users' Group

[ Date Index ][ Thread Index ]
[ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] GCC debug info and some other garbage.



Simon Waters wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Andrew Rogers wrote:


A friend has compiled his program on both GCC 2.96 and MS


Visual C++ (I


don't know which release). He claims that Visual C++ gives a


two fold


speed increase to his program. As I did not want to believe


this I set


about investigating the cause of this apparent speed increase.



As a maintainer of a chess program we have a keen interest in performance.

For C code both Intel and Microsoft compilers outperform GCC on
Intel hardware for most benchmarks, although not usually by 50%.

Most real world applications are closer, and in some cases high
level optimisations in GCC will result in code that performs
commercial compilers.

GCC's real strength is it works pretty well everywhere, not that
it produces the fastest code, which in compilers usually goes to
those who know the hardware best - (read Intels compiler
produces fast code).

Now what is the program doing would be my first question,
especially what system routines, as unless it is producing the
same native system calls it may not be a direct comparison.

The program is used to test a turbo code, this is part of our satellite communications research at the University of Plymouth. Essentially it makes billions of data sequences and calculates the decoding performance for each. There are very few system calls compared to the calculation that goes on. Our programs sometimes need a month to run, that's why performance and compiler optimisation is critical.




I can't seem to find a way to remove this debugging info and
there are no -g switches in my GCC command line.



man strip ?


strip removes some of the stuff, but unfortunately this doesn't lead to an increase in performance.


What does this information look like, what does "file <executable>" return.



Slighty seperate issue, I compiled a program with -O3


(optimisation) on


both GCC 2.96 and GCC 3.2 but they both execute at exactly the


same


speed. I thought that GCC 3.2 had significantly improved


optimisation.

GCC 3 executes GNU Chess with about 20% improvement in nodes per
second on same hardware (Cyrix 166MHz).

You have to have code that the new optimisations work on.....



Is there any new optimisation command line switches in GCC 3.2


that I


may have missed?



I'd suggest profiling and looking at what is actually consuming CPU, and compare between compilers if possible.

I will my friend to do this. I don't have MS Visual C++ so I can't do these tests.

While I was looking at the executable with khexedit I noticed a section of text that looks like this:

GCC: (GNU) 2.96 20000731 (Mandrake Linux 8.2 2.96-0.76mdk)GCC: (GNU) 2.96 20000731 (Mandrake Linux 8.2 2.96-0.76mdk)GCC: (GNU) 2.96 20000731 (Mandrake Linux 8.2 2.96-0.76mdk)GCC: (GNU) 2.96 20000731 (Mandrake Linux 8.2 2.96-0.76mdk)GCC: (GNU) 2.96 20000731 (Mandrake Linux 8.2 2.96-0.76mdk)GCC: (GNU) 2.96 20000731 (Mandrake Linux 8.2 2.96-0.76mdk)GCC: (GNU) 2.96 20000731 (Mandrake Linux 8.2 2.96-0.76mdk)GCC: (GNU) 2.96 20000731 (Mandrake Linux 8.2 2.96-0.76mdk)GCC: (GNU) 2.96 20000731 (Mandrake Linux 8.2 2.96-0.76mdk)GCC: (GNU) 2.96 20000731 (Mandrake Linux 8.2 2.96-0.76mdk)GCC: (GNU) 2.96 20000731 (Mandrake Linux 8.2 2.96-0.76mdk)GCC: (GNU) 2.96 20000731 (Mandrake Linux 8.2 2.96-0.76mdk)

As you can see its repeated about ten times. strip does not remove this so I removed it with khexedit. This did not cause the program to crash although it may be wrong to remove this stuff.

Regards
Andrew Rogers


-- The Mailing List for the Devon & Cornwall LUG Mail majordomo@xxxxxxxxxxxx with "unsubscribe list" in the message body to unsubscribe.


Lynx friendly