Optimization: Slow with too many DEFINE

Recommended Posts

I have been debugging for performance my Oscommerce 2.2 and found out that many DEFINE from the configuration table have been impacting my Website performance, especially after I migrated my website into a different serve.

In a file (cache_configuration_cache.php which load the configuration values), there are more than 550 define (added from module and store)... and that take a huge amount of time.

So in order to test my theory, I just tested the script with only the 550 define and I definitely conclude that by having too many DEFINE variables, that impact the loading time of the script.

And this is related to PHP it seems. I tested also on my local server.

And strange too, if those 550 defines are loaded not on top of the script, the script takes even longer to load.

So with a new install, you won't see the problem because you haven't yet added modules.

So I am looking for ways to optimize...

1°) I am thinking first just to remove unused configuration VARIABLES.

2°) Or maybe the best way would be to only loaded needed VARIABLES.

Let me know what you think about it.

Tested with php 5.1 and 5.3.

Share this post

Link to post

Share on other sites

There is the configuration cache addon for that situation. You should also look through this thread. I'm assuming you realize that optimizing a shop from 10 years ago, or so, is not the best choice but if you make those changes you will see an improvement.