
First Call to DLL is slow
Look at the rebase tool and link option to help you with the task of
changing the default load address:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnma...
l/hood0500.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tool...
til_2z39.asp
http://www.microsoft.com/msj/defaultframe.asp?page=/msj/0498/bugslaye...
tm&nav=/msj/0498/newnav.htm
Dirk
One step you may take to reduce somewhat the initial loading overhead
is to change your DLLs load address. The default value of 0x1000000 is
about guaranteed to encounter collisions and costly relocation. Although
no address is guaranteed to not cause relocation, your chances would be
much better... (You can also investigate what addresses all DLLs are loaded
at and make a more informed decision for this particular scenario.)
--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================
Quote:
> Hello all,
> I have written a COM object using ATL. It has a method that gets
> an XML string, parses it, calculates, and outputs a result XML string.
> I have been trying to measure the time that the object takes to
> generate the string, and I have noticed that the first time the
> program is run, the method takes .3-.4 seconds longer than if it is
> run the second or third time. The project is in a DLL and I'm calling
> it from Visual Basic using the new keyword. The DLL and the client
> app are on the same machine. I have been timing it from just after
> creating the object (using the New keyword) and just before destroying
> the object. Any ideas on what could be causing this time increase,
> and how I could go about reducing it?
> Thanks in advance,
> Nimish