Solve | problem | calculation everyone look.
We know that "&" is faster than using "+" number. Because "+" to the character-channeling variable to do type judgment and conversion.
I didn't come up with any good ideas at the time. Only two times the "&" operation was opened, the speed was raised one times. Still can't solve the problem.
The result is: For I 1 to 5000, I add in the form of a character. Use & operation, to 600-800ms
Now try this one below. A Cstrcat class was built.
<%
Pageexetime1=timer * 1000 ' clock start
Set sc=new Cstrcat
For I=0 to 5000
Sc.add I
Next
Response.Write Sc.value
' End of Time '
Response.Write ", Processed time:" & Fix (ABS (CDBL (Timer) *1000-pageexetime1)) & "Ms</font></p>"
%>
<%
Class Cstrcat ' This is the beginning of classes.
Private I,sa ()
Public Property Get Value
ReDim Preserve SA (i)
Value=join (SA, "")
End Property
Private Sub Class_Initialize ()
I=CLNG (0)
ReDim SA (500)
End Sub
Private Sub Class_Terminate ()
Erase SA
End Sub
Public Function ADD (PS)
If Len (PS) =0 Then Exit function
if (I>=ubound (SA)) Then upsize
SA (i) =ps
I=i+1
End Function
Private Sub upsize ()
Dim u
U=ubound (SA)
ReDim Preserve SA (CLng (u+u*0.1))
End Sub
End Class
%>