Results 1 to 2 of 2

Thread: Performance between ASP and ActiveX DLL

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 1999
    Location
    belgium
    Posts
    74

    Question

    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

  2. #2
    Addicted Member
    Join Date
    Jun 1999
    Location
    Los Angeles
    Posts
    186
    No surprise.
    ASP is very fast indeed. What your Dll brings to your application is maintanibility, extensibility, scalability, security, plus you program in an N-tier model, and if you install your dll in MTS or COM+ you'll get connection pooling. Actually read this:
    http://msdn.microsoft.com/workshop/s...er01242000.asp

    Have fun

    André

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width