php includes

Posted on 2005-04-08
Last Modified: 2013-11-18
Dear all,

when i write this these pages i use include files for to increase flexibility. i  would like to if this increase load of the page, since this inc page would include lot of utilities, constants and so on....
rather than giving every thing in a single file is wise to break up those in to secitons and include as separate files.

Question by:kuhajeya
    LVL 8

    Expert Comment

    Indeed, when including files, they always need to be read (increasing file I/O) and parsed (increasing CPU/memory). So it would be better to only include files whenever you need them.

    On the other hand, files that are used very often are very efficiently handled by your OS. And when you use something like ZEND optimizer, the parsed files are stored. The impact would then be quite little.

    Also, when you are not encountering any problems with your request-load (i.e. the impact on the server with a single call to a page) then you don't need to bother with optimizing this (unless you expect it to be a problem in the future of course).
    LVL 7

    Accepted Solution

    I always think of a glossary when I think of EXT3 or NTFS file systems... Imagine looking for "water" in a dictionary, and it says "See: Liquid". So you look up liquid next.

    Always ask yourself if a division is necessary. If everything can be in one file, that may be better. Really, you're looking at two requests (minimum) per file -- one for the file allocation table, and one for the file, plus seeks for every fragment *N.

    Programs such as eAccelerator and Zend Accelerator fix this somewhat.

    Bottom line, only split when you have to. It's much faster. That and load reused data (READ: Sql and files) into shared memory using a program like eAccelerator. That makes a huge difference.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
    These days socially coordinated efforts have turned into a critical requirement for enterprises.
    Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
    The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now