Re: Comments within code

From: Date: Fri, 02 May 2003 17:16:48 +0000
Subject: Re: Comments within code
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-1175@lists.php.net to get a copy of this message
On May 2, 2003 12:56 pm, Derick Rethans wrote: > On Fri, 2 May 2003, Oto Hlincik wrote: > > 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

« previous php.internals (#1175) next »