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

Andrew Rogers wrote:
> Simon Waters wrote:
>
>> 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.

Okay - I assume by "make" you mean there is very little I/O, so
not so different from a chess program ;-)

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

GCC can have debugging info in optimised code, this is great for
when optimisers messed up, but the only major optimiser mess ups
I ever saw were on Cray's fortran compiler.... But then I spent
a lot of time sorting out Fortran optimisations on Crays.

Stripping it will reduce the size of the executable, but it
won't gain you much performance.

Also the code will usually contain switches for different CPU's,
which you can lose with "-m" (IIRC) but this probably won't make
a jot of difference, my off the bat suggestions would be look at
method call optimisations if the code is slower everywhere, or
the critical loop has some extra invariants in that can be removed.

> 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

Lots of metadata goes into modern executables, don't worry about
it. This kind of stuff isn't going to affect CPU performance,
although editting it might break things.

Find the slowest bit of code by profiling, and either dump
assembler, or perform code inspection, to see if there are any
sillies or trivial improvements.

I've not done much C++ optimisation with GNU g++ but I think you
just use gprof just like with C code for profiling.

Mind just as likely that some changes will speed up the VC++
version as well, call it a useful side effect.


-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE+ZKCpGFXfHI9FVgYRAj/sAKCfDCKFPRD4EMXjBEkI3XHUqC+hkACgnUn/
e4tl6D81fjq9crptvMZvUFw=
=LSrs
-----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