[Ns-developers] GCC 4 -fvisibility=hidden

Gustavo Carneiro gjcarneiro at gmail.com
Sun Jan 25 11:29:55 PST 2009


2009/1/25 Mathieu Lacage <mathieu.lacage at sophia.inria.fr>

> Yes, but:
>
> 1) a large fraction of performance-sensitive code is also 'public' so
> you can't mark it 'hidden' so, you lose all the performance gain of this
> marking (there are 3 big items: the packet.h, simulator.h and object.h
> code).


IIRC, I think what GTK+ and friends are doing these days is actually
maintain a duplicate set of symbols.  For each API function, it is declared
as both a hidden and public, and Gtk+ itself ends up calling only the hidden
symbols, bypassing the GOT indirection, although a public version of the
function symbol is also exported.


>
>
> 2) it is fairly non-trivial to do the initial marking and maintain it
> correctly


Agreed.


>
>
> To summarize, a long time ago, I did already try 1) in a private tree
> but did not gain anything from it besides very marginal gains (about 3%
> wall clock time).


I think I might have more luck with the Python bindings.  There, only one
function (init_ns3) needs to be export, and everything else can be made
private.


>
>
> Mathieu
>
> On Sat, 2009-01-24 at 18:00 +0000, Gustavo Carneiro wrote:
> > Interesting read,
> >
> >   http://gcc.gnu.org/wiki/Visibility
> >
>
>


-- 
Gustavo J. A. M. Carneiro
INESC Porto, Telecommunications and Multimedia Unit
"The universe is always one step beyond logic." -- Frank Herbert


More information about the Ns-developers mailing list