- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I am very baffled by the following issue. If I compile my code as a static lib I get very good performance on my decoding functions ~2.9ms. However, when I compile it as a dll the performance drops down to ~4.1ms. The code is identical, I just toggle where I call ippInit(); when it's a dll I call it in the DLL Main function, when it's a static I call it in the WinMain function. Can someone please give me some insight on what is going on?
Thanks,
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The reasons for time delays associated with loading a shared library are application and OS dependent, other than the delayed load feature used by the IPP 6.1 library, the libraryhas very little control over this issue. You might want to search the web for detailed articles regarding the pros and cons of linking statically versus dynamically.
When you load a statically-linked application your application EXE includes all of those functions that your application requires, and only those functions. So if you use only a small number of IPP functions this is probably the most efficient way to build and load your application. The functions you call are bound directly into your application.
When youlink with the dynamic library, the DLL containsALL the functions associated with the domain. In other words, if you only use 6 IPP functions, all in a single domain, but the domain includes 400 functions, then all 400 functions must be loaded into memory. Obviously, there will be more overhead associated with the initial load of the DLL into memory, and a greater likelihood that some parts of the DLL maybe swapped to disk as the result of changing system memoryand task priorities.
Virtual memory needs, disk performance, size of your application and the associated libraries relative to the amount of free memory, number and types of other processes on the system all contribute to delays in load and run times of your application.
Unfortunately, there is no simple answer. In general, you should get better performance from static linking, but there is no guarantee and the final result depends on your application and your system.
When you load a statically-linked application your application EXE includes all of those functions that your application requires, and only those functions. So if you use only a small number of IPP functions this is probably the most efficient way to build and load your application. The functions you call are bound directly into your application.
When youlink with the dynamic library, the DLL containsALL the functions associated with the domain. In other words, if you only use 6 IPP functions, all in a single domain, but the domain includes 400 functions, then all 400 functions must be loaded into memory. Obviously, there will be more overhead associated with the initial load of the DLL into memory, and a greater likelihood that some parts of the DLL maybe swapped to disk as the result of changing system memoryand task priorities.
Virtual memory needs, disk performance, size of your application and the associated libraries relative to the amount of free memory, number and types of other processes on the system all contribute to delays in load and run times of your application.
Unfortunately, there is no simple answer. In general, you should get better performance from static linking, but there is no guarantee and the final result depends on your application and your system.
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
According to yourdiscriptions, itseems be caused by the overhead of loading dynamic libraries at runtime. as the article mentioned, http://software.intel.com/en-us/articles/performance-slow-down-when-dynamically-linking-with-intel-mkl/
But it may be caused by other reasons,whichdepends onyour problem. For example,some discussion in the forum:
IPP6.1 DLL loading time on XP with VC8
LIB vs. DLL
More detials or a test codeto reproducethe behaviouswould be helpful
Kind Regards,
Ying
According to yourdiscriptions, itseems be caused by the overhead of loading dynamic libraries at runtime. as the article mentioned, http://software.intel.com/en-us/articles/performance-slow-down-when-dynamically-linking-with-intel-mkl/
But it may be caused by other reasons,whichdepends onyour problem. For example,some discussion in the forum:
IPP6.1 DLL loading time on XP with VC8

More detials or a test codeto reproducethe behaviouswould be helpful
Kind Regards,
Ying
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Ying,
Thanks for the reply. I tested further, here is what I did;
1. I removed linking the libs that are not being used
2. I rebooted my machine
3. I ran my app, it worked ~2.9ms time
4. I shut down the app, no errors.
5. I relaunched the app and was back to ~4ms time
6. I repeated steps 2-5 with the same results.
If i do the steps 3-5, I keep the 2.9ms time when I'm in a static lib. I'm confused as to which linkage I should be using... or is this a heapcorruptionwhen using a dll? But I don't understand why it would mess up in the second launch?!
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I switched to run-time linking of my dll from load-time linking and my performance is back. I am still curiouse why this is?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The reasons for time delays associated with loading a shared library are application and OS dependent, other than the delayed load feature used by the IPP 6.1 library, the libraryhas very little control over this issue. You might want to search the web for detailed articles regarding the pros and cons of linking statically versus dynamically.
When you load a statically-linked application your application EXE includes all of those functions that your application requires, and only those functions. So if you use only a small number of IPP functions this is probably the most efficient way to build and load your application. The functions you call are bound directly into your application.
When youlink with the dynamic library, the DLL containsALL the functions associated with the domain. In other words, if you only use 6 IPP functions, all in a single domain, but the domain includes 400 functions, then all 400 functions must be loaded into memory. Obviously, there will be more overhead associated with the initial load of the DLL into memory, and a greater likelihood that some parts of the DLL maybe swapped to disk as the result of changing system memoryand task priorities.
Virtual memory needs, disk performance, size of your application and the associated libraries relative to the amount of free memory, number and types of other processes on the system all contribute to delays in load and run times of your application.
Unfortunately, there is no simple answer. In general, you should get better performance from static linking, but there is no guarantee and the final result depends on your application and your system.
When you load a statically-linked application your application EXE includes all of those functions that your application requires, and only those functions. So if you use only a small number of IPP functions this is probably the most efficient way to build and load your application. The functions you call are bound directly into your application.
When youlink with the dynamic library, the DLL containsALL the functions associated with the domain. In other words, if you only use 6 IPP functions, all in a single domain, but the domain includes 400 functions, then all 400 functions must be loaded into memory. Obviously, there will be more overhead associated with the initial load of the DLL into memory, and a greater likelihood that some parts of the DLL maybe swapped to disk as the result of changing system memoryand task priorities.
Virtual memory needs, disk performance, size of your application and the associated libraries relative to the amount of free memory, number and types of other processes on the system all contribute to delays in load and run times of your application.
Unfortunately, there is no simple answer. In general, you should get better performance from static linking, but there is no guarantee and the final result depends on your application and your system.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your help Paul. I have to research dispatching a little more....

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page