Do comments affect performance?

后端 未结 5 616
囚心锁ツ
囚心锁ツ 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:24

    The biggest effect that comments have is to bloat the file size and thereby slow down the download of the script. Hence why all professional sites use a minimizer for a productive version to cut the js down to as small as it gets.

提交回复
热议问题