general question about lazy loading of shared libraries

John Ellson ellson at research.att.com
Fri Nov 19 12:07:12 UTC 2004


Arjan van de Ven wrote:

>On Thu, 2004-11-18 at 20:06 -0500, John Ellson wrote:
>  
>
>>>I don't know an easy way to tell exactly what pages of the libraries 
>>>you are using are touched and thus read off disk at start up... and it's
>>>not even a well defined question - you can't tell if a page was 
>>>read because of your app or because of another app.
>>>      
>>>
>
>but you can tell which pages are in memory at least. If people want I
>can code a small app for this
>  
>
Don't go out of your way, but if you have some snippets of code I can 
look at it would be appreciated.

>>I'm working on Graphviz graph layout tools that support multiple 
>>renderers. 
>>    
>>
>
>that kind of sounds like a plugin situation, for which dlopen is quite
>suitable.
>  
>
Well, yes, thats the direction I was headed in, but I'm wondering if the 
performance payoff is going
to be worth the effort of hand coding the dlopen plugin support?

If lazy loading, or deferred mmapping into virtual memory, is 
implemented well then
why bother with plugins?     (Separate compilation is marginally 
attractive, but performance is king.)

>>Does the deferred paging depend on prelinking having been performed?
>>    
>>
>
>no that happens always (even with the main binary btw); the difference
>prelink makes is that without prelink you need to touch (and thus load)
>more pages even if you don't use the library, for relocations.
>  
>
So if I understand, deferred paging doesn't depend on prelinking, but if 
I am going to try to measure
avoided-page-loads then I should make sure that prelinking has been done?

John




More information about the devel mailing list