Haz un archivo ASP, copia estos códigos y coméntanos tus conclusiones:
Código asp:
Ver original'MODO 1
tiempoinicio = Timer
For i = 1 To 800000
%>*<%
Next
tiempototal = FormatNumber(Timer - tiempoinicio, 3, True)
Response.Write "<br>MODO 1: " & tiempototal & "<br>"
'MODO 2
tiempoinicio = Timer
For i = 1 To 800000
Response.Write "*"
Next
tiempototal = FormatNumber(Timer - tiempoinicio, 3, True)
Response.Write "<br>MODO 2: " & tiempototal & "<br>"
'MODO 3
tiempoinicio = Timer
With Response
For i = 1 To 800000
.Write "*"
Next
End With
tiempototal = FormatNumber(Timer - tiempoinicio, 3, True)
Response.Write "<br>MODO 3: " & tiempototal & "<br>"
Luego, corre estos otros dos códigos que comparan la impresión directa VS la concatenación:
Código asp:
Ver original'MODO 4
tiempoinicio = Timer
Cadena = ""
response.write "<ul>"
for i = 1 to 10000
response.write "<li>" & i & "</li>"
next
response.write "</ul>"
Response.Write Cadena & "<br>"
tiempototal = FormatNumber(Timer - tiempoinicio, 3, True)
Response.Write "<br>MODO 4: " & tiempototal & "<br>"
'MODO 5
tiempoinicio = Timer
cadena = "<ul>"
for i = 1 to 10000
cadena= cadena& "<li>" & i & "</li>"
next
cadena= cadena& "</ul>"
response.write cadena & "<br>"
tiempototal = FormatNumber(Timer - tiempoinicio, 3, True)
Response.Write "<br>MODO 5: " & tiempototal & "<br>"