Using procedures and functions has great benefits for the organization and maintenance of your code, especially when some of the code in the page needs to be used more than once. However, it is a disadvantage to have a function (or procedure) call to complete the same processing task at this point in time. Theoretically, the variables within the function block are more efficient. Let's take a look at the test results for these two questions.
8.1 Moving the Response.Write statement into the child procedure
In this test, we just put the Response.Write statement into the sub process.
...
Call Writetable ()
SUB writetable ()
Response.Write ("< HTML >" & _
"< head >" & _
...
"< TR >< TD >< B >EMail:</b ></td >< td >" & EMail & "</td ></tr > "& _
"< TR >< TD >< B >birth date:</></td >< td >" & Birthdate & "</td > </tr > "& _
"</table >" & _
"</body >" & _
"End SUB
/app2/function1.asp Fragment
Benchmark = 5.57 MS/page
Response time = 6.02 MS/page
difference = +0.45 milliseconds (increase by 8.1%)
As expected, child process calls add additional page handling burdens.
8.2 Moving all scripts into the child process
In this test, Response.Write and all the variable declarations are moved to the sub process.
<% OPTION EXPLICIT
Call Writetable ()
SUB writetable ()
Dim FirstName
...
Dim Birthdate
FirstName = "John"
...
Birthdate = "1/1/1950"
Response.Write ("< HTML >" & _
"< head >" & _
"< title >response test</title >" & _
""< BODY >" & _
"< H1 >response test
"< table >" & _