Re: Re: Functions vs html outpuit

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

 



On Sunday 03 September 2006 09:00, Alex Turner wrote:

> I would go for the optimize late philosophy.  Once you have a site
> running, load testing it with - eg - JMeter.  If a PHP page is taking a
> lot of the time and it could easily be converted to static HTML, do it
> at that point.  If you code raw HTML everywhere, then you might find
> that you have spent a day messing with a page that only gets hit once a
> day :-(
>
> Best wishes
>
> AJ

"Pre-mature optimization is the root of all evil."

Unless you're building something you know will be very time sensitive, or a 
part of the code that you know will run every single page view, optimize 
first for maintainability/modifiability.  That is, write code that is easy to 
understand and easy to tweak.  That means opting for generalized, flexible 
code when possible.  Sometimes that will mean writing all your HTML via 
print, sometimes it will mean static HTML files (although it almost never 
does for me), sometimes that will mean including a mostly-HTML file with PHP 
print statements into a mostly-PHP function to use as a poor man's template.  

In my experience, the time it takes to connect to your SQL database in the 
first place will be an order of magnitude larger than whatever it is you're 
doing anyway. :-)  

-- 
Larry Garfield			AIM: LOLG42
larry@xxxxxxxxxxxxxxxx		ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it."  -- Thomas 
Jefferson

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