Does ASP function calling affect performance?

Source: Internet
Author: User

I did a test just now. The test results are as follows:
<%
starttime = timer
'=== super connection ================ ======================< br> function linkto (strurl, strtext, strtype, Strid, strclass, strtitle)
If Len (strtext) = 0 then
response. write "parameter error! "
exit function
end if
If Len (strtype) = 0 then
strtype =" location. href "
else
strtype = strtype &". open "
end if
If Len (strtitle) <> 0 then
strtitle = "Title =" & strtitle & "
else
strtitle =" Title = "& strtext & "
end if
If Len (strurl) = 0 then strurl = "#"
If Len (Strid) <> 0 then Strid = "id =" & Strid & "
If Len (strclass) <> 0 then strclass = "class =" & strclass & "
linkto =" "& strtext &" "
end function
for I = 0 to 2000
If I> = 2000 then exit for

Response. Write linkto ("? Show = best/"& boardid & extname &" "," EssenceArticle","","","","")
Next
Endtime = Timer
Response. Write ("<br>") & vbcrlf
Response. Write (endtime-starttime) * 1000
%>
The test runs for about 46 milliseconds.

<%
Starttime = Timer
For I = 0 to 2000
If I> = 2000 then exit
Response. Write "<a href = '? Show = best/"& boardid & extname &" '> excellent articles </a>"
Next
Endtime = Timer
Response. Write ("<br>") & vbcrlf
Response. Write (endtime-starttime) * 1000
%>
The test runs for about 15 ms.

The above two tests are performed on the local machine, and each cycle is 2000 times. The results are clear at a glance. The final conclusion is that ASP calls to functions will affectProgramPerformance.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.