Performance four, how does annotation in ASP code affect execution efficiency?
Many HTML developers know that adding HTML annotations is a bad habit. This is because: first, the annotation increases the amount of data transferred; second, the HTML annotation provides other developers with information about the page organization. So what about the comments in the ASP page? Comments in ASP are never seen by browsers, but they increase the size of the script that the ASP engine resolves.
In this test, we added 20 lines of comments, 80 characters per line, and a total of 16,000 characters.
<% OPTION EXPLICIT
'-------------------------------------------------------------------------------
... Lines ...
'-------------------------------------------------------------------------------
Dim FirstName
...
/app2/comment_1.asp Fragment
Benchmark = 5.57 MS/page
Response time = 5.58 ms/page
difference = +0.01 milliseconds (increase by 0.1%)
The result of the test was surprising. Although annotations increase the file size by more than twice times, the impact on response time is minimal. Therefore, we have the following rules:
If you use moderation, ASP annotations have minimal or no impact on performance.