locked
Single vs Multiple dlls RRS feed

  • Question

  • Hi,

    I am building an ATL COM DLL component. There are many functions to be exported (around 100). I want to ask about the performance gain/loss in case I build a single DLL exporting all functions or in other case build multiple dlls.

    Thanks & Regards,
    Omer Javed
    Tuesday, September 19, 2006 6:52 AM

Answers

  • If all functions are used in the same client, it is better to keep them in one Dll. Loading one large library to memory is faster than loading number of small libraries.
    Tuesday, September 19, 2006 10:57 AM
  • I think this is obvious: to load one file, Windows must find it on the disk, allocate memory space and load it to memory. To load number of small files, Windows must make the same for each file.
    Wednesday, September 20, 2006 12:37 PM

All replies

  • If all functions are used in the same client, it is better to keep them in one Dll. Loading one large library to memory is faster than loading number of small libraries.
    Tuesday, September 19, 2006 10:57 AM
  • Alex,
    Thank you for the guidance. Can you explain why is it faster to load one large library instead of several small ones? I guess it has something to do with the way Windows manages memory for processes but it would help a lot if you shed some more light on it.

    Thanks & Regards,
    Omer Javed
    Wednesday, September 20, 2006 4:38 AM
  • I think this is obvious: to load one file, Windows must find it on the disk, allocate memory space and load it to memory. To load number of small files, Windows must make the same for each file.
    Wednesday, September 20, 2006 12:37 PM