Do comments affect performance?

后端 未结 5 610
囚心锁ツ
囚心锁ツ 2021-02-05 11:05

Am I correct to say that JavaScript code isn\'t compiled, not even JIT? If so, does that mean that comments have an affect on performance, and I should be very careful where I p

5条回答
  •  梦如初夏
    2021-02-05 11:34

    It may have some effect. Very minimalistic effect, though (even IE6 handles comments correctly ! to be confirmed...).

    However, most people use a minifier that strips off comments. So it's okay.

    Also:

    V8 increases performance by compiling JavaScript to native machine code before executing it.

    Source

提交回复
热议问题