Results 1 to 7 of 7

Thread: What's Quicker?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2000
    Location
    Sudbury, Ontario, Canada
    Posts
    274
    Stupid question but which way is faster, if at all?

    Code:
    <%
    Response.Write "File # " & strfilenum
    %>
    or
    Code:
    File # <%=strfilenum%>
    Thanks


  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Technically, the second, since it doesn't have to concatenate the string first. However the difference is so marginal that you'll probably never notice.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2000
    Location
    Sudbury, Ontario, Canada
    Posts
    274
    That's what I though, however if I'm iterating through a recordset I'd like for it to be as fast as possible.

  4. #4
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    In that case, avoid changing between ASP / HTML. As in, the second way, it swaps between them. If you're looping through a recordset, keep it all in ASP code for speed.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2000
    Location
    Sudbury, Ontario, Canada
    Posts
    274
    Sounds good.

    Thanks,

  6. #6
    Fanatic Member Ianpbaker's Avatar
    Join Date
    Mar 2000
    Location
    Hastings
    Posts
    696
    There isn't any difference apart from the concatenation as mentioned.

    If you have an error in what is being outputed using the <% = blah %>, the error message that comes up is Error - type mismatch in response.write(blah).

    so I don't think there is any difference apart from the time it takes to write it.

    Ian
    Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!

  7. #7
    Addicted Member
    Join Date
    May 2000
    Location
    Grand Rapids, MI
    Posts
    231
    I always considered the first to be typically faster, if you stayed in ServerSide script long
    for example

    <%
    .....
    %>

    the doted line being several lines , and all responses are sent with Response.write, and %> isnt reached until page is finished.
    -Karl Blessing aka kb244{fastHACK}
    [email protected]

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