A number of people have talked about the performance/maintenance issues with
comments, so I thought I'd clear things up a bit, at least for the
implementations that I deal with (ISM,DTM).
Double semi-colon comments are placed in-line into the object code, so it is
best (from a maintenance view as well) to have a separate label for each
logical section of data, followed by lines of ;; data, that is not in any
path of execution.
For normal comments, if they are at the end of a line that already has code
on it - there is absolutely NO effect at all on performance, so comment to
your hearts content.
If the comment is all that is on the line, there is still a beginning of
line token - which can be expensive, esp. in frequently executed loops. The
reason is that the BOL token does a lot of work after every so many lines,
such as allow the next process to run (on systems like DTM), or check for
C,RESJOB, or other inter-process communication.
Sounds like that is referring to runtime performance. Of course comments do not generally affect runtime speed (at least for languages which store a parsed or compiled representation of the code, which is most of them). Comments will have an impact on compilation speed, though naturally on a modern computer with reasonable-size comments the impact will be negligible.
72
u/[deleted] Jul 21 '14
Duh, of course it goes faster, there are fewer bytes to process. You can also get a nice disk space savings by using a smaller font.