Why is the startup of an App on linux slower when using shared libs?

后端 未结 6 1874
执笔经年
执笔经年 2021-01-23 05:11

On the embedded device I\'m working on, the startup time is an important issue. The whole application consists of several executables that use a set of libraries. Because space

6条回答
  •  太阳男子
    2021-01-23 05:59

    Interesting.. typically loading time for a shared library is unnoticeable from a fat app that is statically linked. So I can only surmise that the system is either very slow to load a library from flash memory, or the library that is loaded is being checked in some way (eg .NET apps run a checksum for all loaded dlls, reducing startup time considerably in some cases). It could be that the shared libraries are being loaded as-needed, and unloaded afterwards which could indicate a configuration problem.

    So, sorry I can't help say why, but I think its an issue with your ARM device/OS. Have you tried instrumenting the startup code, or statically linking with 1 of the most commonly-used libraries to see if that makes a large difference. Also put the shared libs in the same directory as the app to reduce the time it takes to search the FS for the lib.

提交回复
热议问题