You are here: Re: [PHP] Re: Performance & Comments Question « PHP « IT news, forums, messages
Re: [PHP] Re: Performance & Comments Question

Posted by Jochem Maas on 01/19/06 15:09

Barry wrote:
> Rodolfo Andrade wrote:
>
>> Hi all!
>>
>> I would like to know if comments in the code affects the performance.
>> I know
>> that comments are ignored by the interpreter, but it does increase the
>> file
>> size, so I was thinking about a possible performance hit for highly
>> commented files.
>>
>> Can anyone confirm this?
>> Thanks!
>>
>> Rodolfo Andrade
>
>
> Im not quietly sure how the parser works but
> i think it stops reading a line for example when the // or # are detected
>
> how its about /* and */ im not quitly sure.
> but i think this commenting will affect the parser in some way.

the comments are parsed by the parser and can be extracted/used for doc building
etc - this means there is some overhead for commented files.

if you use an opcode cache then the overhead is only relevant at the time
a source file is compiled into opcodes (I don't know any opcode cache that
doesn't strip out the comment tokens from the compiled code)

in real life you won't notice the overhead at all.
and people will love you if you'r files are 90% comments :-)

>
> And yes i also think commenting affects the parser.
> Not much though but well it does.
>
> Barry
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация