Performance
As mentioned in the readmap update, performance will be the key thing in the upcoming 0.6.3 release.
While there reamain still things to be improved, the already implemented changes will make things way faster.
One very obvious thing to do to make things faster is to cache generated HTML. The cache could be memory, the filesystem or even the database (in certain situations). For ZenMagick, I chose the filesystem, as it is fast and there are existing solutions to handle cached data. Zenmagick is going to use Cache_Lite.
The implemented infrastructure is quite simple, but that makes it hopefully fast enough to be of some value. Currently, there is only a global page cache that manages full pages. While this is the best option with regards to performance, there are drawback, especially when it comes to dynamic page content.
In order to minimize sideeffects, the current caching strategy implemented will onyl cache pages if:
- The shopping cart is empty
- The page is non SSL
- The page is not a checkout page (this includes the shopping cart)
There are issues left, especially if banners are used and expected to change often. Managing caching will be addresed once I get around to write some proper configuration management code.
Cache options so far include the cache directory and the time-to-live for cache files. The admin menu will provide the option to manually clear the cache.
The second, more exiting, way of improving performance that will be in 0.6.3, is the option to compress and fold the complete core directory into a single core.php file. This will dramatically reduce the init phase as there is only a single file to include as opposed to about 170! The PHP code will also be stripped of comments and whitespace to further reduce the size of core.php.
My tests indicate a gain of about 300 ms per request. It only takes some time to adjust to the fact that changes are not immediately active when modifying core files ![]()
