Jump to content

Optimization for uncalled Functions.


omkarkhair

Recommended Posts

I am using a PHP include file for my site, which includes validation functions used throughout out the site. Like string type, alphanumeric values, etc. Its completely customized for the types of user inputs the site takes.

 

The problem is, each page uses only about 2-3 functions from the whole list of 16.

 

One of the pages gives a memory_get_usage() of 748KB. If I remove the Inluded file, it goes down by 200KB. While the include file is of 4KB and the test page is 2KB.

 

I am looking for a method to optimize the memory allocation. I dont want to write the code separately for each file.Is there a method to optimize for uncalled functions?

 

Thanks in Advance.

Link to comment
Share on other sites

If I remove the Included file, ...

 

Ummm. Clearly that prevented your code on your page from executing fully, either directly due to fatal runtime errors (functions on longer being defined), or indirectly because you altered the remainder of the code on the page somehow.

 

It would take seeing all the code that produces/reproduces the the symptom in order to be able to specifically help you (in programming that is rarely one answer that fits every situation, without knowing exactly what that situation is.)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.