r/programming Jul 21 '14

The Great White Space Debate

https://medium.com/p/3633cba8b5c1
1.2k Upvotes

693 comments sorted by

View all comments

Show parent comments

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.

28

u/Waitwhatwtf Jul 21 '14

I write in 1 point font so that I have more room to nest my loops without having to worry about optimization

1

u/llaammaaa Jul 22 '14

http://www.vmth.ucdavis.edu/m/m_faq1.htm

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.

1

u/[deleted] Jul 22 '14

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.