From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,352a5b864cce614f X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1993-10-16 10:47:44 PST Newsgroups: comp.unix.osf.osf1 Path: gmd.de!newsserver.jvnc.net!howland.reston.ans.net!europa.eng.gtefsd.com!uunet!noc.near.net!mv!fastball.unimaster.com!cherkus From: cherkus@fastball.unimaster.com (Dave Cherkus) Subject: Re: better performance through static linking? Nntp-Posting-Host: cherkus.mv.com References: Sender: usenet@mv.mv.com (Usenet News) Organization: UniMaster, Inc. Date: Sat, 16 Oct 1993 17:21:05 GMT Message-ID: Reply-To: cherkus@UniMaster.COM In article , hirai@cc.swarthmore.edu (Eiji Hirai) writes: |> If I compile my heavily used programs with "LDFLAGS = -non_shared" (i.e. |> static-ly link my object files), will this have any speed improvements when |> I execute the binary? Is this a useless exercise or will I gain something? It depends. Small, frequently executed programs will be faster linked non-shared. This is because the startup cost of shared executables is greater than the cost of nonshared executables. Another cost associated with shared libraries is the cost of mapping the entire set of libraries into your address space when you might only be using a tiny subset of the code in these libraries. In some cases reducing the virtual size of the process is a performance win. Of course, having the shared libraries reduces disk space usage, increases maintainability and allows the library code segments to be shared at run time. ---- Dave Cherkus UniMaster, Inc. cherkus@unimaster.com