February 1, 2009

reducing price related database queries

One of the new features in the upcoming Zen Cart 2.0 version is going to be a reduced number of database queries for price lookup. Most of those queries are attribute related and therefore do not affect all stores/products.

Due to the current work on making ZenMagick properly available for Zen Cart templates, I’ve had the chance to do some easy comparisons.

For fun (and to be used on the demo site), I’ve hacked together a simple plugin that will allow to enable/disable ZenMagick theme support. That means it will be possible to comapre each page (except for ZenMagick specific like static pages) by using a new link at the page top (see image)

theme_toggle

The interesting bit is the number of database queries shown at the bottom, though. For this simple comparison I disabled sideboxes via a custom configure.php (Zen Cart):

define('COLUMN_LEFT_STATUS', 0);
define('COLUMN_RIGHT_STATUS', 0);

and custom layout settings for ZenMagjck:

ZMLayout::instance()->setLeftColEnabled(false);
ZMLayout::instance()->setRightColEnabled(false);

And here are the numbers for both Zen Cart and ZenMagick:

Zen Cart:

db_queries_zc

ZenMagick:

db_queries_zm

(The interesting number is the first, the second is just the number of queries done via the ZenMagick wrapper around Zen Cart’s $db).

And this is for a single product! This version of the API (and a similar good version) have been around in ZenMagick for quite a while and there are a few more tweaks coming when I find the time!

No Comments

No comments yet.

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.