Quick Question...
How does a large amount of Comments within code (especially Class
definitions) affect script performance?
Thanks,
Oto Hlincik
Quick Question...
How does a large amount of Comments within code (especially Class
definitions) affect script performance?
Not that much, it's mostly the reading of it that will take the most
time. It can't be an excuse to not document your code ;)
Derick
--
"my other box is your windows PC"
Derick Rethans http://derickrethans.nl/
PHP Magazine - PHP Magazine for Professionals http://php-mag.net/
Quick Question...
How does a large amount of Comments within code (especially Class
definitions) affect script performance?Not that much, it's mostly the reading of it that will take the most
time. It can't be an excuse to not document your code ;)Derick
If 40%+ of your total script size are comments you may see something like a
2-4% performance boost if you remove those comments for files >40kb. However,
this should not be used as an excuse not to write comments and if you are
using an opcode compiler the difference is NILL. However, if you absolutely
must remove the comments & other useless white space. Before putting your
script into a production enviroment run it via 'php -w script_name.php', this
will strip out the whitespace and dump you the stripped file to stdout.
Ilia
Not that much, it's mostly the reading of it that will take the most
well, it's quite depended on the comments form[1] ;)
[1] http://bugs.php.net/bug.php?id=23285
--
moshe