locked
ASP classic “execute” is incredibly slow on local server RRS feed

  • Question

  • User1316495770 posted

    I am executing these two cycles in Classic ASP:

    for g=1 to 5000
        dummy=1
    next
    

    and

    for g=1 to 5000
        execute("dummy=1")
    next
    

    On cloud server (Windows 2008 with IIS 7.5) these two cycles are executed in 0 seconds. On a local powerful machine (with Windows 10) the first cycle is executed in 0 seconds, the second one in about 40 seconds. And every time I relaunch the same script, the execution time increases by some seconds!!

    Tried on a second Windows 10 machine (IIS 10.0), same results.

    Cannot understand what is happening, any ideas?

    This is the script I'm using for testing:

    <%
    server.scripttimeout=9000000
    
    starttime=now()
    response.write "<b>Default method</b><br>Start time: "&starttime
    response.flush  
    
    for g=1 to 5000
        dummy=1
    next
    
    response.write "<br>End time: "&now()
    response.write "<br>Time elapsed: "&datediff("s",starttime,now())&" seconds"
    
    starttime=now()
    response.write "<br><br><b>Execute method</b><br>Start time: "&starttime
    response.flush  
    
    for g=1 to 5000
        execute("dummy=1")
    next
    
    response.write "<br>End time time: "&now()
    response.write "<br>Time elapsed: "&datediff("s",starttime,now())&" seconds"
    %>

    Please help!!! smile
    Thursday, February 8, 2018 11:59 AM

All replies

  • User-460007017 posted

    Hi Nientezero,

    Your code execute the execute() method 5000 times. If I only execute it hundreds times or sever times, it return 0 second. Only when I execute 5000 times, it return 5s time taken. Different method with different source code different algorithm could have different execution performance. And it should not be an IIS issue. In addition, the different hardware also provide the different operation performance.

    Best Regards,

    Yuk Ding

    Friday, February 9, 2018 7:21 AM
  • User30296483 posted

    Thank you Yuk Ding for your answer.

    Your result (5 seconds) confirms that there is definitely something not working in IIS 10.0 and/or Windows 10.

    I tried the same test on a Windows Server 2008 server running IIS 7.5, and even increasing the cycle by 100 times (500,000 iterations) the time taken is just 2 seconds.

    Friday, September 7, 2018 12:57 PM
  • User638361585 posted

    Watch your Task Manager under the Processes tab.  When I run your code on my Win10 box, I notice the Antimalware Service Executable start using up CPU aggressively, then slacks off.  I do not get the same lag as you, i.e. 40 seconds.  More like 5-10 at most.

    Wednesday, September 19, 2018 10:19 PM