Asp classic ASP Classic-自今年最近的一次windows更新以来,为类中的字段赋值的速度非常慢

Asp classic ASP Classic-自今年最近的一次windows更新以来,为类中的字段赋值的速度非常慢,asp-classic,Asp Classic,今年早些时候,我的一位同事在开发环境中遇到了一个问题,我已经调查了这个问题并发现了问题所在。他和我的机器唯一的主要区别是我没有运行windows更新。从那时起,我的电脑已强制更新,现在问题发生在我的机器上 我们都在运行windows 10 pro、IIS 10.0.17132.1 这个问题。在经典的asp中,当为类字段赋值或从字段中读取值时,现在花费的时间比预期的要长得多 使用public或private(与getter/setter一起使用)对速度没有影响 我已经在我们的一台服务器上测试了这个

今年早些时候,我的一位同事在开发环境中遇到了一个问题,我已经调查了这个问题并发现了问题所在。他和我的机器唯一的主要区别是我没有运行windows更新。从那时起,我的电脑已强制更新,现在问题发生在我的机器上

我们都在运行windows 10 pro、IIS 10.0.17132.1

这个问题。在经典的asp中,当为类字段赋值或从字段中读取值时,现在花费的时间比预期的要长得多

使用public或private(与getter/setter一起使用)对速度没有影响

我已经在我们的一台服务器上测试了这个问题,它没有受到这个问题的影响。它的性能与我以前的机器非常相似

我在下面包含了我的测试脚本。下面是我们看到的测试结果

服务器定时。 计数:100000,分配时间:0.359375,测试时间:0.222656,其他时间:0.527344,总时间:1.109375,错误:0

<%

dim t, startTime, totalTime, assignTime, testTime, otherTime, n, max, classArray(), data, testVal, errors

class mytest
    public myval
end class

startTime = timer
assignTime = 0
testTime = 0
max = 100000
if isEmpty(request("max")) = false and isNumeric(request("max")) = true then max = cLng(request("max"))
if max < 1 then max = 1
errors = 0
redim classArray(max)

for n = 1 to max
    set data = new mytest
    t = timer
    data.myval = "test_" & n
    assignTime = assignTime + (timer - t)
    set classArray(n) = data
next

for n = 1 to max
    set data = classArray(n)
    t = timer
    testVal = data.myval
    testTime = testTime + (timer - t)
    if testVal <> "test_" & n then
        errors = errors + 1
    end if
next

totalTime = (timer - startTime)
otherTime = totalTime - assignTime - testTime

response.write "Count: " & max & ", "
response.write "Assign time: " & round(assignTime, 6) & ", "
response.write "Test time: " & round(testTime, 6) & ", "
response.write "Other time: " & round(otherTime, 6) & ", "
response.write "Total time: " & round(totalTime, 6) & ", "
response.write "Errors: " & errors & "."

%>
当地时间安排。 计数:100000,分配时间:14.07813,测试时间:13.73438,其他时间:0.460938,总时间:28.27344,错误:0

<%

dim t, startTime, totalTime, assignTime, testTime, otherTime, n, max, classArray(), data, testVal, errors

class mytest
    public myval
end class

startTime = timer
assignTime = 0
testTime = 0
max = 100000
if isEmpty(request("max")) = false and isNumeric(request("max")) = true then max = cLng(request("max"))
if max < 1 then max = 1
errors = 0
redim classArray(max)

for n = 1 to max
    set data = new mytest
    t = timer
    data.myval = "test_" & n
    assignTime = assignTime + (timer - t)
    set classArray(n) = data
next

for n = 1 to max
    set data = classArray(n)
    t = timer
    testVal = data.myval
    testTime = testTime + (timer - t)
    if testVal <> "test_" & n then
        errors = errors + 1
    end if
next

totalTime = (timer - startTime)
otherTime = totalTime - assignTime - testTime

response.write "Count: " & max & ", "
response.write "Assign time: " & round(assignTime, 6) & ", "
response.write "Test time: " & round(testTime, 6) & ", "
response.write "Other time: " & round(otherTime, 6) & ", "
response.write "Total time: " & round(totalTime, 6) & ", "
response.write "Errors: " & errors & "."

%>

从调查中,我还发现问题似乎在于对类的调用,而不是在类中应用数据

将我的类调整为有两个字段,并生成一个同时设置这两个字段的函数(或将这两个字段作为数组读取)。手动设置两者所需的时间是一个函数调用设置两者所需时间的两倍。读回数据也有同样的影响

<%
class mytest
    public myval
    public myval2
    public function setdata(v1, v2)
        myval = v1
        myval2 = v2
    end function
    public function getdata()
        getdata = array(myval, myval2)
    end function
end class

set data = new mytest
data.myval = "test"
data.myval2 = "test2"

set data = new mytest
call data.setdata("test", "test2")
%>

我花了数小时在网上搜索与此相关的任何内容,但找不到任何内容

所以

还有其他人看到过这个问题吗

它是否会影响其他人的开发环境

有人对如何解决这个问题有什么想法吗?

谢谢@erik

我想投你一票,但在你的评论旁边似乎没有向上的箭头。但是非常感谢

是的,服务器上的vbscript.dll版本不同。我已经替换了我的开发环境和同事机器上的DLL,问题已经解决了。我们正在监控日志,看看使用服务器DLL是否有任何不利影响,但到目前为止,一切看起来都不错

在我可以替换DLL之前,我必须从TrustedInstaller获得DLL的所有权,但在那之后一切都顺利进行,我不确定我是否必须这样做,但我在完成后将所有权还给了TrustedInstaller

服务器和我们的开发机器都是windows更新的,所以我假设DLL的差异是特定于平台的,或者可能是windows 10中的某些东西,他们希望解决这些差异,但没有将其放入更新时推送到服务器的版本中

细节

system32\vbscript.dll

Windows 10 DLL 25/07/2018 17:31(版本5.812.10240.16384)

Windows server 2012R2 DLL 19/07/2018 05:33(版本5.8.9600.19101)

syswow64\vbscript.dll


日期和版本均与system32相同(文件大小不同,但这是意料之中的)。

Hi Dave。能否检查服务器和工作站上vbscript.dll的版本是否存在差异?您可以在c:\windows\system32和c:\windows\sysWOW64中找到副本。我认为vbscript.dll是用Internet Explorer更新的,它是经典ASP/vbscript的引擎。另一个想法是:这可能与修复处理器中的幽灵和崩溃错误有关吗?我了解到这些修复可能会对某些程序产生负面影响。这可能是其中之一。