Re: Re: Performance & Comments Question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, January 19, 2006 7:09 am, Jochem Maas wrote:
> Barry wrote:
>> Rodolfo Andrade wrote:
> and people will love you if you'r files are 90% comments :-)

Actually, the times I've seen THAT much commenting, it was generally a
lot of useless "noise" and I hated it...

Consider this common practice:

/**
  Function: foo
   Purpose: foo the input string and return a string
    Inputs: $string, the input string
    Output: result string of foo
    Author: Some I. Guy <sguy@xxxxxxxxxxx>
      Date: 4/1/2005
**/
function foo($string){
  //code I don't understand
  return $result; // I got this part :-)
}

Note: The Author no longer works at Example, and his email address is
invalid, of course.

If you're going to comment, then comment on the high-level stuff of
what you are *DOING*, not the minutia I can read in the source in the
first place!

Oh yeah:
Comments with increased file size certainly matter, depending on the
disk block size, the OS cache size, PHP's cache sizes, the number of
times you foolishly 'include' them, the number of files you've broken
things into, etc...

You'd have to have a HELL of a lot of comments for that part to matter.

The PHP parser can't be working TOO hard to rip out comments -- It
doesn't even allow nested comments /* ... /*  ... */  ... */ so it
only has to scan ahead for the character combination '*/' and that's
pretty fast.

If you are using an opcode cache, it becomes even more meaning less,
as noted.

You could almost for sure find a comment-stripper "out there" and
benchmark for yourself on your own hardware:
http://info.com/php+comment+strip

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux