Loading time for shared libraries vs static libraries

后端 未结 3 1350
感情败类
感情败类 2020-12-28 10:27

I have a question on shared libraries vs static libraries loading time.

Assume that i have a executable foo.exe which uses liba, libb, libc. Also at a given time th

3条回答
  •  遥遥无期
    2020-12-28 10:57

    Thanks a lot for this unbelievably fast response. we have 2 architecural scenarious :

    Q1. Architecure-1 :Assume exe size 3GB (static libraries). 95% is libraries and 5% main().With such a huge size would loading of this exe take more time (assuming static libraries) or would linking of this exe take more time (assuming using shared libraries, and if all libraries are already in memory only linking has to be done.)

    Architecure-2 :Assume i have a exe size 1.5GB (95% lib + 5% main()), and 6 instances of this are running at the same time. Once these 6 instances are up they will run for days, assume we are ready to take the extra delay during initial loading+linking of these 6 instances.

    Q2. Now if i am using shared objects rather than static objects, will i have lot of free space on the RAM since all the libraries are shared amongst the 6 instances ? will not my realtime execution speed up because of more space in RAM which decrease the page swapping ?

    Q3. If i use 'map' files to decrease the number of symbols exported (which is only possible using shared libraries) will not my symbol table size decrease and will it not improve the runtime performance ?

    Thanks Sud

提交回复
热议问题