Re: Structured Code vs. Performance

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

 



news_yodpeirs@xxxxxxxxxxxx wrote:
I got different portions of code only used for certain purposes (who don't ;-)?). But what, in your opinion (better: in your experience) would be the best regarding script-performance: Putting each code-portion in a separate file and include it if required, putting it in a constant-dependent if-structure (if (defined('FOO') && FOO) {class foo{}; function foo(); ...}) or simply let it be parsed every time?

Make your code readable and manageable first, then worry about the rest. I always go for multiple files because it means the project is much more manageable.

My first choice is using separate files, but if a file e.g. only contains 20 lines, I fear it would take much longer to include the file against simply parsing these lines in the existing file.

Put your "misc" functions in one file and include it when you need it.

--
Postgresql & php tutorials
http://www.designmagick.com/

--
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