Arne said:
I have a 500 page ASP program that takes 1-2 seconds to
execute. For some strange reason it takes 20-30 seconds
before the first lines executes.
How can I make this program behave better?
Possible causes of delay include initialization code in:
- Application_OnStart code in global.asa,
- Session_OnStart event code in global.asa,
- the script,
- any COM+ component startup latency.
Does this occur only on the first execution of the script and not on
successive executions? Reason I ask is that the first time an ASP script
is executed it must be compiled to bytecode: the bytecode is cached in
IIS and on subsequent requests fetched and executed without any
compilation. Compilation is *very* CPU-intensive: if the script is
large, compilation may cause a perceptible time delay.
If this is the case, then a possible solution is to establish a
procedure to execute the page immediately after IIS startup, thereby
reducing the likelihood that a user would experience the delay.
Read more on the details of ASP caching and compiling in Appendix 3 of
http://www.microsoft.com/technet/prodtechnol/iis/iis5/maintain/optimize/iis5tune.asp?frame=true#h
Good Luck,
Michael D. Kersey