We need you!

We're working hard on the next version of Developer Fusion. Let us know what you think we should be up to!

Members

Technology Zones

Articles

Hosted By

MaximumASP

Info

Rated
Read 36,579 times

Contents

Downloads

Related Categories

String Concatenation Component - Introduction

streamload

Introduction

I wrote this component - StrCat.Catter - because string concatenation in Visual Basic (Script) has poor performance characteristics. I found that code like this:

<%
  Dim rs
  Set rs = ExecuteSql("SELECT Username FROM Users")

  Dim some_str
  some_str = ""

  do until rs.EOF
    some_str = some_str & rs(0) & "<br>" & vbCrLf
    rs.MoveNext
  loop

  Response.Write some_str
%>

performed very poorly. The code took a long time to execute, during which time the processor was totally saturated. I found articles on MSDN stating that this type of code was a bad idea, and I've heard that this type of concatenation results in run times that are proportional to the square of the number of concatenations.

Shameless Plug
These and many other cutting-edge techniques power Streamload.com, a digital entertainment delivery site offering unlimited free online stora

Comments

  • ASP can be fast, too.

    Posted by Dogbite on 06 Jun 2003

    A great idea! You can also reduce concatenation times by using arrays and the built-in Join() function. No components required. Similar performance gain. Very readable syntax (once you understand ...