Performance impact of comments in scripts

Hi All,

Am working on a very large script that I have commented reasonably well in order to provide documentation (outside of the normal get-help comments), however a significant number of scripts online have next to zero inline comments in the code. Given that powershell needs to load a script into memory including comments, I presume there is some sort of memory overhead, however cant find references to there being a noticeable performance penalty.

Was wondering if there is any guidance / performance impact of including comments within code and if there are any noticeable performance impacts with releasing code including comments?

There are a number of ‘remove comment’ scripts available, however including comments in code is automatic behavior for me, so just trying to understand the implications of leaving them in.

submitted by /u/IsThatAll
[link] [comments]

Leave a Reply