title: Does exporting everything from DLL affect performance
body: <p>To do unit testing I had to export many small, internal classes which were never intended for consumption by the clients of my DLL.</p>
  
  <p>I know that each exported function results in a stub in executable image and that Windows loader has to perform fix-up on those stubs if DLL is not loaded at its preferred location.</p>
  
  <p>Someone suggested building DLL as a static lib, solely for the purposes of unit testing.</p>
  
  <p>I wonder if it is worth the trouble? I could find no reference to how significant a problem of exporting every class from DLL may be, or is there any significant gain in loader performance and memory consumption if I am selective about it.</p>
  
  <p>I think I read somewhere that GCC compiler exports everything by default.</p>
  
  <p><strong><em>EDIT</em></strong>: since the stated motivation for the question is disputable, let me rephrase it:
  Should I go through my DLLs and remove DLLEXPORT on all classes that are not exposed to its clients? Let's say I am working with a bunch of legacy DLLs and I noticed they have a lot of unnecessary exports. Will that improve the speed of loading? Specifically on Windows 7 and 8 using MSVC version 9+.</p>