Re: [PHP] Includes eating up my time



Dave M G wrote:
Currently, my processes are taking under a second, but they can be
around half a second or more. Although it all happens too fast for me to
really notice as a person, it seems to me that a half second of
processing time might be kind of long and lead to scalability problems.
That's hardly the worst performance I've seen from a CMS, but you should know that nearly all CMS systems are slow, many slower than this, for similar reasons. The solution is usually to build a front-end cache, either in the CMS itself or using an external tool. For instance, MODx caches internally, while others rely on Apache/Enfold/etc.
My first question is: Is a half second too long? I'm pretty sure it is,
but maybe I'm just being paranoid. What do people consider to be
acceptable time frames for processing a web page similar to what
Wikipedia delivers?
When you quote Wikipedia, you do realize that they're not a CMS, right, that they're a Wiki? There are some subtle differences. I haven't looked at Wikipedia's Wiki code (I like TWiki) but the Wikis I've used don't actually use a database or a billion classes to get their work done. They're more focused on editing an entire page of static content, which is stored on disk (and thus directly accessible by the server).

If you want that kind of scalability you also MUST implement some sort of caching. PHP is a scripting language, and no scripting language will ever keep up with compiled code, no matter how good (and PHP is good). You might also consider looking at the Zend Optimizer - I've never tried it, but have heard good things.
My second question is: Is there a systematic way of determining how to
incrementally include files that people use? Or is it just a constant
process of testing and checking?
PHP does have an auto-include system called the autoloader. We use this heavily in Blackbird ESB to load classes on the fly when they're referenced. It only works for loading classes, but since you say that's what you have... Take a look here:
http://us.php.net/autoload

Regards,
Chad
.



Relevant Pages

  • Re: [SLE] PHP sessions
    ... The CMS requires: php_value session.save_handler files ... The wiki requires: php_value session.save_handler user ... The problem is one PHP is set for one session save handle, ... Any suggestion on how to set it for each virtual host? ...
    (SuSE)
  • Re: Python equivalent to SharePoint?
    ... they do to use their CMS or intranet solution as yet another "shared ... be coerced into editing Wiki content; the PyCon UK site had even more ... consultant, and apart from the fancy drag-and-drop layout tools I was ... control systems and their integration with Web-based solutions. ...
    (comp.lang.python)
  • Re: Joomla?
    ... Just like all to many power point templates the tend to all look the ... more important to roll your own then use a CMS (if you want to look ... Related to PHP Development ... way CMSs handle authentication, user management, or some other ...
    (comp.lang.php)
  • Re: [PHP] Re: Separate PHP Code From HTML || Pros & Cons
    ... This presents problems in that any updates I make to the CMS only affect ... the other issue I'd like to address is separating PHP code logic from ... I've often heard the mantra, "separate code from HTML", but it seems ... snippet files are small functions where recursions help displaying some ...
    (php.general)
  • Re: Need advices in choosing approach
    ... PHP 5 is only recently started to really supersede PHP 4, ... For example on the CMS I'm developing I ... functionality that all types of item the CMS works with needs, ... planning and design work to be carried out before you can start coding ...
    (comp.lang.php)