Saturday 25 April 2009

Cache Fixed, Results Mixed

I finished my "newrouter" branch today. The idea was to clean up the way that stores, websites, and routers interact with the cache. Basically, everything in the XML tag gets copied around under and tags as a way to allow someone to change default settings, but still keep custom changes per store. Well, the result is a horribly bloated XML file, about 4 times larger than it needs to be, because so many modules put everything into "default". Things not related to stores at all.

So, I ended up cutting out that copying of XML and replacing it with a block of code that simply checks the default branch if a specific tag doesn't sit under a store or website. Pretty simple. It cuts the size of the cached config file way down, but it doesn't reduce the peak memory usage much. That must be in the database where peak memory is used.

The trade off comes from having to constantly look up config settings in two places. This should have given a 5-7% boost, but in the end, only about 2-3% boost because of the increased processing. Still though, a boost is a boost. It will probably speed up hits which rebuild the cache too. I haven't stress tested anything thoroughly. All the tests are done on the front page of a store with sample data. Mind you, this is 2-3% on top of the already 20-25% over Mage 1.3.0.

No comments: