| Static linking is always going to be the very best for run-time
performance. However, the inherent penalty should not be all that
large (unless all your programmers subscribe to the structured
programming school where all routines are less than 10 lines long...)
when you use DLLs instead. There will be some startup costs.
Larger variations in run-time are more likely due to cache
problems due to the resulting layout of the program and/or the lack
of all the magic things that might happen if the sources are
compiled or linked together (and the routines are inlined, etc.).
If you are observing a really large penalty, I'll bet a careful
analysis will show it's the cache. For 10%, I'm not sure the
analysis is worth it. Is the 10% for a program that runs for an
hour? A minute? 5 seconds??
Cheers!
Dave Eklund
|
| Dave, Many thanks for the quick reply!!
> Larger variations in run-time are more likely due to cache
> problems due to the resulting layout of the program and/or the lack
> of all the magic things that might happen if the sources are
> compiled or linked together (and the routines are inlined, etc.).
> If you are observing a really large penalty, I'll bet a careful
> analysis will show it's the cache. For 10%, I'm not sure the
> analysis is worth it. Is the 10% for a program that runs for an
> hour? A minute? 5 seconds??
I'm still waiting to hear what their *real* problem is (10% of what etc) and to
get info on the apps structure, build commands etc. In the meantime I was
investigating the DLLIMPORT stuff. One theory is that cache could get hurt if
every call to a DLL function jumped via a thunk, rather than an indirect jump
via the import address table (a la C). I too doubt that this alone would hurt
performance by 10%, but stranger things have happened!!
So can DLLIMPORT's use in Fortran generate code as Visual C++ does? - i.e. not
jumping to a thunk, but jumping indirectly to the DLL function using the import
address table. If so, where do I put the CDEC$ statements and are there other
compile and/or link requirements to get this to happen.
Thanks again,
Stephen
|
| I'm not familiar with what Visual C++ has done. I'm pretty sure
that f77 (and f90) have not yet done anything special, but I'm taking
a quick look now at what might be done. However, I would not bet my
next paycheck that this will get back 10% of the time!
Cheers!
Dave Eklund
|