|
-
May 22nd, 2000, 01:25 PM
#1
Thread Starter
Lively Member
Hi,
I supposed that compiled VB-code, in an ActiveX DLL, was working better than the same in ASP-code. Here is my code.
My ASP-Page
<body>
<%
if trim(len(request.form("f_Hit"))) > 0 then
'Calling my VB-DLL
response.write(time & "<br>")
Set cstring = server.createobject("Concat_String.String")
if request.form("f_hits") <> "" then
cstring.al_hits = request.form("f_hits")
end if
test = cstring.create_string
response.write(cstring.as_string)
end if
if trim(len(request.form("f_Hit_ASP"))) > 0 then
'With ASP
response.write(time & "<br>")
sstring = "string "
if trim (len(request.form("f_hits"))) > 0 then
for i = 1 to clng(request.form("f_hits"))
sstring = sstring & i & " * string"
next
end if
response.write(sstring)
end if
%>
My VB-DLL is the following
Option Explicit
Private ms_string As String
Private ml_hits As Long
Public Property Get as_string() As String
as_string = ms_string
End Property
Public Property Let al_hits(ByVal value As Long)
ml_hits = value
End Property
Public Sub create_string()
Dim i As Long
ms_string = "string "
For i = 1 To ml_hits
ms_string = ms_string & i & " * string "
Next
End Sub
--> As you see, the loop in ASP is the same as in VB.
When I'm running the two possibilities with 15000 hits,
the asp takes 46 seconds and the VB-DLL takes 56
seconds.
Can anyone explain me the reason?
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|