Any speed issues with DLL's

Started by
1 comment, last by sethiroth 21 years, 8 months ago
Just wondering if i had some graphics functions inside a DLL to do my rendering or whatever else, would using a DLL slow down things at all, i assume it probably would a little bit, but not very sure on this
Advertisement
If you are using .Net and a .Net based dll...nope. Otherwise, I''m not sure...I don''t think it would though, I don''t see any reasons for a performance hit.

"Wisdom is proportionate to your reference base. Intelligence is the ability to appropriately use that Wisdom."
"Wisdom is proportionate to your reference base. Intelligence is the ability to appropriately use that Wisdom."
Nope, it wouldn''t slow things down. We do it in our engine.

DLLs get mapped into the address space of your process (your main program).

The addresses of any imports (functions in the DLL used by the main program) get fixed at load time so that the calls point directly to the DLL calls. So it ends up no different to a non-inlined function in your main program!

One thing to be aware of though is if the main program (or anything it calls) needs to create/destroy threads with any kind of regularity make sure you call DisableThreadLibraryCalls() in response to a DLL_PROCESS_ATTACH message in your DllMain().

To be on the safe side I''d still ensure that you don''t use DLL functions for high frequency calls (i.e. if you have a DLL function which transforms a single vertex which gets called tens of thousands of times in a frame, then you probably have a bad design!)

--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com

Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site

This topic is closed to new replies.

Advertisement