Do comments slow down an interpreted language?

后端 未结 11 2266
深忆病人
深忆病人 2020-12-01 09:59

I am asking this because I use Python, but it could apply to other interpreted languages as well (Ruby, PHP, JavaScript).

Am I slowing down the interpreter whenever

11条回答
  •  没有蜡笔的小新
    2020-12-01 10:30

    The effect is negligable for everyday usage. It's easy to test, but if you consider a simple loop such as:

    For N = 1 To 100000: Next
    

    Your computer can process that (count to 100,000) quicker than you can blink. Ignoring a line of text that starts with a certain character will be more than 10,000 times faster.

    Don't worry about it.

提交回复
热议问题