[DUG] DLL loading slowed by anti-virus

Ross Levis ross at stationplaylist.com
Tue Sep 22 16:45:49 NZST 2015


You mean leave the DLL loaded permanently and switch to it when required?  I thought of that but the code is quite tricky as it is in that app.  I was hoping to not modify that app and just load the DLL’s in another one.  I take it my original plan would work?

 

From: delphi-bounces at listserver.123.net.nz [mailto:delphi-bounces at listserver.123.net.nz] On Behalf Of Jolyon Direnko-Smith
Sent: Tuesday, 22 September 2015 3:24 p.m.
To: NZ Borland Developers Group - Delphi List
Subject: Re: [DUG] DLL loading slowed by anti-virus

 

Hi Ross,

Rather than have an application load 30 DLLS (none of which it uses) for the sake of another application which might use as few as just 2 of those 30 and only ever one at a time, why not simply cache each loaded DLL in the application that is actually using them ?

 

I would hope that your function references to the DLL exports are already maintained in a record or even behind a class facade, which would make a cache simplicity itself to implement.  If not, introducing such a facade should be straightforward enough.

With such a cache you still get the initial delay but only for the first use and only for the DLL's actually being used and it eliminates any question about (or possible future variance in) the module loading behaviour of the OS or any problems arising as a result of your "loader" application failing to have loaded at/by the required or expected time etc.

 

--

Jolyon

 

On 22 September 2015 at 14:42, Ross Levis <ross at stationplaylist.com> wrote:

My automation app loads 1 of perhaps 30 different 3rd party DLL’s depending on the job required.  It only has to do 1 job at a time and if the job changes (automatically), the current DLL is unloaded and the relevant one is loaded using LoadLibrary.  All the DLL’s have the same interface/functions.

 

It seems in recent times that the loading of a DLL is taking much too long for many customers, sometimes several seconds, which isn’t acceptable, and it appears to be related to anti-virus software scanning the DLL every time it loads, or at least the first time it has loaded on that day.  That seems to vary in different anti-virus software.

 

I need to remove that delay.  I would rather the main app not load every single DLL at startup as that would take a long time to load, and often only 2 or 3 of the DLL’s will ever be used by a customer.

 

There are 2 apps loaded at the same time and rather than altering the app that loads the DLL’s and does all the work, my thought was to have this 2nd app load all the DLL’s in the folder using a thread.

 

Am I correct that a 2nd app loading the same DLL will not actually load the DLL from the hard drive but just access it from RAM, so it should load very quickly?

 

Cheers,

Ross.


_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: delphi at listserver.123.net.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-request at listserver.123.net.nz with Subject: unsubscribe

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserver.123.net.nz/pipermail/delphi/attachments/20150922/9c139f70/attachment-0001.html 


More information about the Delphi mailing list