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.



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

On Monday 03 Mar 2003 8:14 pm, 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. The
> program was compiled on Visual C++ as 'release', I don't have Visual
> C++, but presumably this means that there is no debugging info in the
> executables. When I looked at the executable produced by GCC there seems
> to be alot of debugging stuff in the executable file. I suspect that
> this debugging info is causing the slower execution of the GCC compiled
> version. I can't seem to find a way to remove this debugging info and
> there are no -g switches in my GCC command line.

Have you tried $ strip progfile
?
man strip
strip - Discard symbols from object files.

>
> Is there any way to have GCC not output the debugging info?

Usually strip is called as part of the 'release' package - say RPM - or via 
the Makefile.

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

Don't most optimisations depend on the program itself actually implementing 
suitable functions and operations? 

Also, are you comparing like with like? Visual C++ (as Borland C++ and others) 
often relies on DLL's to code most of the work so the executable will be 
smaller. If both programs are statically linked, you may find a reversal in 
file size and perhaps speed. Dynamically linked libraries DO count as part of 
the overall application size whatever the compiler/OS - just look at the 
problems with some VBrun dll's and RPM dependency problems.


- -- 

Neil Williams
=============
http://www.codehelp.co.uk
http://www.dclug.org.uk

http://www.wewantbroadband.co.uk/

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE+Y9LriAEJSii8s+MRAl7KAKDJ85MSv3YJmzessS921aHY3q6XogCfdQS4
7RvDFajOnnLBCuG1GgWKarU=
=7g/0
-----END PGP SIGNATURE-----


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


Lynx friendly