No ASP Comments?
I got dragged into a third party code review for some friends who had an IIS / VBScript / ASP / MSSQL site developed. One of the first things I noticed was a complete lack of documentation (no shock) and also a complete lack of comments in the ASP and SQL code (unpleasant, but, again, no shock).
That's ridiculous. There is no performance reason not to include ASP comments.
Is he meaning that under heavy load, the commented parts of code may cause errors? I definately don't think that would be the case.
I submit that they DON'T show up under stress... His!
If they 'did' show up under stress can you imagine how many articles we all would have ready by now about this?
Quite a number of years ago my company did some web contract work for a large, Redmond based company. This was NT 4.0, IIS 4.0 days mind you. They decreed that we must ship them 2 versions of the code, 1 with comments and 1 without. They would not deploy any ASP code with comments for performance reasons.
isn't that what preprocessors are for?
Are you working with the guy I used to work with? Because he had convinced management that "Comments slow down ASP" - and I had to fight that nonsense for 2 years!
Can anyone prove that they don't slow it down?
It would be pretty easy to do some tests with the Web Application Stress Tool to determine if comments slow things down or not.
OK, this is silly, it makes no difference at all. Next please :)
ASP has been mainstream for what, 6-7 years? Yet I don't recall ever seeing or hearing of an "ASP Comment Stripper" - it seems like if comments were that big a problem, we'd have them right next to the obfuscators and line number generators.
"I mean, this is not compiled code, every time the thing runs if it has to parse out the comments, doesn't that add some execution time?"
Sum Dum Gai
Performance time for this snippet was the same with zero and 200 comment lines inside the loop.
There is a measurable difference between a heavily commented and a non-commented ASP file, however the difference is marginal and not really worthy of consideration -- if you are _really_ trying to eak every last cycle out of the app, then sure maybe there should be no comments, but if you're using ASP it's pretty clear that ultimate performance isn't the top priority (no this isn't an indictment of ASP, but rather that if you are at the point that you're stripping/avoiding comments because of a <1% speed improvement, maybe you need to look into custom ISAPI modules, ASP.NET, etc).
You guys know more about this than me, but I was under the impression that the latest version of ASP *was* compiled. Is the debate about asp 3.0 (EG Classic)?
Indeed VBScript.NET in ASP.NET is compiled, and the notes about comments are entirely inapplicable, however the lack of .NET specific comments leads me to believe that the original poster was asking specifically about ASP 3.0 ("classic"). This seems reasonable given that there are currently a tremendous number of ASP 3.0 sites in active development or maintenance.
> the author declared he would not use inline comments in ASP "due to its interruptive nature, which may show up under stress."
>When an ASP page is first loaded, it's parsed into an in memory structure. That structure is then cached.
If he's worried about speed, introduce him to Visual C++ and either CGI or ISAPI modules. CGI is slower, but ISAPI modules don't like to be changed very often, which makes them undesirable for development.
"due to its interruptive nature, which may show up under stress."
"Yes but IIS only caches the last 50 (iirc) requested pages so if you are running a number of reasonably busy sites you can overflow the cache easily enough and the parsing time becomes a factor."
Fog Creek Home