#native_company# #native_desc#
#native_cta#

dealing with overhead of large code base

By Niels Peen
on September 22, 2000

Those of you dealing with a larger code base all know the overhead this can cause. Even if you include only the files you really need or write some nifty loader which loads only the required files the performance can still be lower then you would like.

Then we noticed the current PHP4 version in CVS (2000-09-08) supports server sockets. What we did is simple. We split our application up in 2 parts. The first part is our large code base which we just load completly and then have it listen on a socket. Then we create a very simple frontend which opens a connection to our codebase and returns the result.

To pass our cookies and get and post variables to our backend we put these and all other stuff we want to pass on in an array which we serialize and pass to the backend.

Depening on how suitable your code base is (you need to have your functions return stuff instead of echo, and be clean with your use of variables, clearing database results,etc) this could mean an extreme performance increase with only 15 minutes work as it did for us.