Julien,

On 4/23/07, Julien BLACHE <[EMAIL PROTECTED]> wrote:

Weiter Leiter wrote:

> The "hit" only affects the loader. After relocation is done (i.e.
> program is running), there is no difference between a statically and a
> dinamically linked executable, concerning performance.

That's for the static vs. dynamic library, not for the non-PIC vs. PIC
code...

Dynamic library does not mean PIC; with some effort, needs for PIC can
probably be removed from OpenSER's to-be libs.

OTOH, PIC is only about dynamic libraries, and the only issues concern
static and global variables, which are, indeed, addressed using one and
respectively two extra steps (ELF's GOT address loaded - as expensive as a
function call, but most probably done once at funtion entry - and relocated
pointer in GOT dereferenced for non statics - casual memory op cost).
This occurs in few cases (even with large libraries), generally, and
particularly for the proposed parser library (at a fast sweep, I only
identified one non static global and three statics that might even be
'stacked', in this effort).

So, OK, PIC can induces a penalty, per textbook manual, but hardly
"performance hits". I set aside the number of mainstream PIC libraries.

IMHO, shared  or static lib is no solid topic.

WL.

JB.

--
Julien BLACHE                                 <[EMAIL PROTECTED]>
Linbox / Free & ALter Soft                       <http://www.linbox.com>




--
"C is a language that combines all the elegance and power of assembly
language with all the readability and maintainability of assembly language."
_______________________________________________
Devel mailing list
Devel@openser.org
http://openser.org/cgi-bin/mailman/listinfo/devel

Reply via email to