I have a very large script with dozens of files. Many of these files have literally HUNDREDS of lines of commented out lines. Also, Ive seen some HTML templates have many, many commented lines included. I was curious to see what everyone thought about how this affects the loading time of the pages, whether all these comments slow the time down on the server side or the browser side. By removing commented files on some large pages, Ive cut the size of some files down by 10k or more!
I wrote an article on website optimization, but I can't give you the link because I haven't been a member for 7 days :/ PM me if you want it The comments do take up space, so does whitespace. As much as possible should be removed, but the best way is combining images.
What about a whole lot of lines like this: <?php content here; ?> <?php another line here; ?> If you change it to something like this: <?php content here; another line here; ?> ie. reducing the amount of php tags when there is no html or other type of language in between.
That would speed it up only if you have hundreds or thousands, PHP is a hard language to optimize. Optimization is all about your use of html, javascript and images.
I was able to trim off over 2MB of comments and blanksapce from the files in the wp-includes folder of wordpress alone!
Erasing the comment codes will actually decrease the file size (i.e. the HTML file size). However I am not sure that will speed up the load time if you erase the file, but indeed it will decrease the file size. As far as it regards the optimization part for loading faster the site I would pay more attention to the javascript's you might be eventually using and on the images. Example, if a big images of same horizontal lines is being used as big images, you might want to slice that image at 1px width and the complete height (unless the bottom part is not of one color, in that case you could use background color for the rest of the background image) and simply repeat-x this image through CSS. Back to your question...I wouldn't say that erasing comments will really have a drastic change in the loading speed.
If this is a WordPress site,then install the SuperCache plugin...it loads the big time blogs up at lightening speeds.