public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Code Optimization
@ 2002-10-06 23:54 Taha Mannan Jiruwala
       [not found] ` <o7elb2zrrk.fsf@tooth.toronto.redhat.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Taha Mannan Jiruwala @ 2002-10-06 23:54 UTC (permalink / raw)
  To: gcc

Hi,

I have around 10k lines of C++ code on linux.
I want to know of any pointers for Code Optimization Techniques
using compiler and linker options. I am using g++.

regards,
taha


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Code Optimization
       [not found] ` <o7elb2zrrk.fsf@tooth.toronto.redhat.com>
@ 2002-10-07  6:48   ` Taha Mannan Jiruwala
  2002-10-07 13:36     ` Alexandre Oliva
  0 siblings, 1 reply; 3+ messages in thread
From: Taha Mannan Jiruwala @ 2002-10-07  6:48 UTC (permalink / raw)
  To: Ben Elliston; +Cc: gcc

I have checked the gcc manual and found some useful options.

I think I have not put my problem statement clearly, here it goes:
Basically my goal is to reduce the code footprint without significant
reduction in performance.
----------------------------------------------------------------------
My application has a set of libraries and executables
- When I link them statically, the exe sizes increase
- When I make them shared libraries, the performance of my application is
affected drastically.

My Approach:
- Reduce library size
- Find a shared library solution that is efficient (Does not drastically
reduce performance, may be something Intermediate to shared and static
approach)

TIA,
taha


Ben Elliston wrote:

> >>>>> "Taha" == Taha Mannan Jiruwala <taha@sasken.com> writes:
>
>   Taha> I want to know of any pointers for Code Optimization Techniques
>   Taha> using compiler and linker options. I am using g++.
>
> Have you checked the GCC manual?
>
> Ben

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Code Optimization
  2002-10-07  6:48   ` Taha Mannan Jiruwala
@ 2002-10-07 13:36     ` Alexandre Oliva
  0 siblings, 0 replies; 3+ messages in thread
From: Alexandre Oliva @ 2002-10-07 13:36 UTC (permalink / raw)
  To: Taha Mannan Jiruwala; +Cc: Ben Elliston, gcc

On Oct  7, 2002, Taha Mannan Jiruwala <taha@sasken.com> wrote:

> I think I have not put my problem statement clearly

In fact, you haven't even mentioned which architecture you're
targeting.  This can make a lot of difference as to the set of options
available.

> - Find a shared library solution that is efficient (Does not drastically
> reduce performance, may be something Intermediate to shared and static
> approach)

You may try to create dynamic libraries out of non-PIC.  Assuming this
is an IA32 architecture (in which -fPIC makes a lot of difference
given how register-starved it is), it can help speed up the
application code, at the expense of a lot of additional run-time
relocations, that will impact library load time.

Unfortunately, if you care about portability across multiple targets,
then creating dynamic libraries out of non-PIC is not an option.

You may consider using symbols of hidden visibility within the shared
library, such that function calls don't have to go through a PLT.
This may save space (for relocations), time (for relocations and
function calls).

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                 aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-10-07 19:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-06 23:54 Code Optimization Taha Mannan Jiruwala
     [not found] ` <o7elb2zrrk.fsf@tooth.toronto.redhat.com>
2002-10-07  6:48   ` Taha Mannan Jiruwala
2002-10-07 13:36     ` Alexandre Oliva

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).