phpperformanceoptimizationinterpreter

Will PHP be slower if we add too many comments in code files?


Possible Duplicate:
Commenting interpreted code and performance
Does comments affect when including files in PHP?

Let's say we have 100 class files and everytime when a page is requested, all these classes must be parsed by PHP.

Will PHP be slower if almost 1 half of the source code lines are the comments? Because usually I add a lot of comments & descriptions to code. This doesn't matter to compilers coz comments are not compiled, but PHP is interpreter, any bad thing may happen?


Solution

  • Yes, but it's minimal, and this can (and should) be addressed entirely by using APC or another opcode cache. As a bonus, APC will speed everything else up as well.

    If your site is slow, comments are not the reason.